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 :: !D3gnd :: d8led :: d7start = [gnd=0,led=Button *]or simply load the sketch in the workspace with the command
] load e05_buttonInitialize the system with the command:
] startthe 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: