cancel
Showing results for 
Search instead for 
Did you mean: 

Let the LED flash 3 times without using a blocking code

FLamb.2
Associate II

The point is that when you press a button, an LED should flash three times.

If you press the button again while it is flashing, the LED must flash 3 times again.

The whole thing should be implemented without blocking code.

I could could use a loop to make the LED blink 3x, but then I would have implicit blocking code in there again.

How can I implement this without blocking code?

1 REPLY 1
Uwe Bonnes
Principal II

Set up a timer to flash the LED with PWM and set the repetition counter accordingly. Start the timer as one short.