Controlling an External LED
In this project, you'll learn how to connect and control an external LED.
Before you do this project, you'll first need to know how to use a breadboard, and how a LED works
- Click here to find out how to make connections with a breadboard.
- Click here to find out how a LED works.
Parts needed:
| ||
Questions:
How do you turn on a LED? Connect it to a power source. (If you don't know how to do it then read this first.) How do you turn off a LED? Disconnect it from the power source. How do you make a LED blink once? Connect and then disconnect the LED from the power source. How do you make a LED blink continuously? Keep connecting and disconnecting the LED from the power source. | ||
This is very tiring and boring! | ||
To automatically turn on and off a LED, we need to get the Arduino to control it by connecting one leg of the LED to a digital I/O pin on the Arduino board. The pins labeled 2 to 13 on the Arduino board are the digital I/O pins. |
| |
1 | Making the connections
| |
2 | Create a new program by selecting File from the menu,
and then select New. You will see this new template. | |
3 | Type in this program.
The The The 1000 ms = 1 sec | |
4 | Upload and run the program. You should see the external LED blink on for 1 second and then off for another second. | |
How (not) to blow up a LED. If you have not read the document on how a LED works then you should read it before going any further, otherwise you'll end up with a lot of blown up LEDs. | ||