Skip to main content
FLamb.2
Associate II
January 27, 2021
Question

Let the LED flash 3 times without using a blocking code

  • January 27, 2021
  • 1 reply
  • 980 views

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?

This topic has been closed for replies.

1 reply

Uwe Bonnes
Chief
January 27, 2021

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