How to delay until a next increment of time occurs ?
Dietmar Schwertberger
maillist at schwertberger.de
Fri Nov 15 14:32:44 EST 2019
On 14.11.2019 21:00, R.Wieser wrote:
> There is a small 433 MHz rf transmitter connected to the pin, and when I
> send the right pattern a wireless wall-wart will respond and switch a lamp
> on or off. Its just ment as an example of a real-world application of
> Python, nothing serious.
I would assume that this is not an application that needs to output a
100% correct pulse train every time. (Based on the assumption that the
telegrams for on and off are different enough.)
You may just repeat the pattern ten times to be safe enough.
Combine it with a light sensor for feedback ;-)
Btw. you may want to increase the priority of your task. I'm using this
code on my Raspi to reduce the interference of other processes with my
media player using Python with gstreamer:
os.system( "sudo renice -15 -p %d"%os.getpid() )
Anyway, Micropython on a microcontroller would probably be the best
solution.
Regards,
Dietmar
More information about the Python-list
mailing list