Path: csiph.com!usenet.pasdenom.info!aioe.org!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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: UNSURE 0.313 X-Spam-Level: *** X-Spam-Evidence: '*H*': 0.44; '*S*': 0.06; 'python.': 0.02; 'low.': 0.16; 'subject:skip:m 10': 0.16; 'subject:python': 0.16; 'library': 0.18; 'variable': 0.18; 'module': 0.19; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'character': 0.29; 'code': 0.31; 'pipe': 0.31; 'another': 0.32; 'problem': 0.35; 'subject:with': 0.35; 'there': 0.35; 'event,': 0.36; 'much.': 0.36; 'implement': 0.38; 'thank': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'duration': 0.60; 'event.': 0.60; 'signal': 0.60; 'extended': 0.61; 'high': 0.63; 'kind': 0.63; 'sample': 0.67; 'started.': 0.68; 'electronics.': 0.84; 'pardon': 0.84; 'received:192.168.1.7': 0.84; 'received:195.238': 0.84; 'received:195.238.6': 0.84; 'received:195.238.6.173': 0.84; 'received:belgacom.be': 0.84; 'received:isp.belgacom.be': 0.84; 'received:mailrelay007.isp.belgacom.be': 0.84 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBALLigFJbs+f0/2dsb2JhbAANTMArgn2BUIMaAQEEeBELIRYPCQMCAQIBRRMIAogCqwiKK4kUj24WhBoDmA+VMQ Date: Mon, 11 Nov 2013 15:00:27 +0100 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130922 Icedove/17.0.9 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Implementing a multivibrator function with python References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 11 Nov 2013 15:02:01 +0100 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384178523 news.xs4all.nl 15996 [2001:888:2000:d::a6]:34146 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59076 Op 11-11-13 10:41, JL schreef: > 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? > > Thank you very much. > The problem is that it depnds on the kind of trigger event. Is it a signal? Is it a character that arrives through a pipe or socket? I would take a look at the signal module and see if it can get you started. -- Antoon Pardon