top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Implementing a multivibrator function with python

+1 vote
402 views

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?

posted Nov 11, 2013 by Satish Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
More precisely a retriggerable monostable multivibrator.

The question makes little sense unless you're running in an event  driven environment, such as a gui. Name the environment and somebody can probably help.

1 Answer

+1 vote
 
Best answer

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.

answer Nov 11, 2013 by Deepankar Dubey
Similar Questions
+1 vote

I want to introduce the debug print something like this but in Python code.

#ifdef DEBUG_ENABLE
DEBUG_PRINT print
#else
DEBUG_PRINT

Is it possible to implement something similar in python?

–1 vote

R has the function edit() which allows the editing of the definition of a function. Does python have something similar so that users can edit python functions on the fly?

Ref:
https://www.rdocumentation.org/packages/utils/versions/3.4.3/topics/edit

...