Posts: 1
Joined: Sat Aug 17, 2019 9:55 pm

led.blink from gpiozero always end in off?

Sat Aug 17, 2019 10:05 pm

I would like to toggle several GPIO pins X amount of times at a specific rate (up to 23KHz). Each pin would have its own rate and number of toggles. led.blink looks like it would work well for me, but... I might need to toggle it five times and end with the led in the on position. From my understanding led.blink will turn it on and off again X amount of times and not give me what I want. Can anyone confirm this? Any suggestions on how to do this without led.blink?


User avatar
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: led.blink from gpiozero always end in off?

Sun Aug 18, 2019 6:42 am

Just issue led.on() immediately after led.blink() concludes?

Or implement your own version of led.blink() that works to your own preference. The source code for the released version is here: https://gpiozero.readthedocs.io/en/stab ... s.html#LED

Return to “Python”