Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'yet.': 0.04; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'low.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:skip:m 10': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'library': 0.18; 'variable': 0.18; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'installed': 0.27; 'point': 0.28; 'function': 0.29; 'am,': 0.29; 'code': 0.31; 'another': 0.32; 'problem': 0.35; 'subject:with': 0.35; 'case,': 0.35; 'but': 0.35; 'there': 0.35; 'event,': 0.36; 'module.': 0.36; 'should': 0.36; 'implement': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'duration': 0.60; 'extended': 0.61; 'new': 0.61; 'received:173': 0.61; 'high': 0.63; 'sample': 0.67; 'believe': 0.68; '3.4': 0.84; 'electronics.': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Implementing a multivibrator function with python Date: Mon, 11 Nov 2013 05:58:18 -0500 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-59-117-133.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384167526 news.xs4all.nl 15913 [2001:888:2000:d::a6]:40004 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59063 On 11/11/2013 4:41 AM, JL wrote: > I am trying to implement a multivibrator function with python. This is how it works; > > - An trigger event happens > - Upon receiving the event, a variable goes high for 5secs, then go low. > - If the event happens again before the 5secs expire, the high duration will be extended by another 5 secs. This works like a retriggerable multivibrator for those who are into electronics. > > Is there some sample code for this problem or can someone point me to using the right library for this feature? Python 3.4 will have a new asyncio package that includes an event loop module. It will be in the forthcoming 3.4.b0 release; it might be in 3.4.a4 but I have not installed that yet. In any case, I believe it should make the above easy. -- Terry Jan Reedy