This digital input example uses a Button to turn on and off a led.
Connect the Button and the led as shown in Figure 1:
Notes:
The longer LED PIN is the positive.
Button PINs can also be inverted.
Write a sketch K to define:
Button :: !D3
gnd :: d8
led :: d7
start = [gnd=0,led=Button *]
or simply load the sketch in the workspace with the command
] load e05_button
Initialize the system with the command:
] start
the LED is off.
If you press the button the LED lights up and if it is released the LED goes out.
In this lesson you learned or repeated: