Here is a device that turns on the LED for ten seconds on boot.
The delay
node helps us with this task. Generally, this node is used to postpone a pulse for some time, but when the delay
node is activated it also outputs True
value on the ACT
pin. That’s what we need.
Let’s modify the device so that the LED turns on for three seconds on a button press.
boot
with the a button
node and bind the corresponding PORT
.SET
pin of the delay
node.T
value to 3.Press the button and see how the LED behaves. Try to press the button many times while the LED glows and see how each press postpones the delay to be elapsed three seconds after the last press.
Combine a few delay
nodes by chaining DONE
and SET
pins to get a custom pattern of the blinking LED. Use the or
node to combine ACT
values as necessary.