Project 7: Button
Objective: To program a button to perform an action.
Before we begin, switch to Live mode
-
Prepare these components
-
Construct the circuit as shown below.
-
After constructing the circuit, we will have to test if the button is working.
-
Press the external push button switch and observe if LED 3 turns on.
-
If it is still does not work, try setting digital pin 3 to HIGH by placing this code on your workspace and double-clicking it.
-
If it is not working, please check your circuit.
-
Once it works, type in the following code.
-
Execute the code and observe the results. Does the LED on Pin 8 lights up when you press the button? If so, then you may proceed to the challenge.
Challenge
Create a circuit and program where when you press the button, three different LED will light up.
Once completed, inform your teacher to check your progress.