Blink - My First Arduino Project
In this project, you'll learn about the Arduino IDE programming environment and how to make a LED light blink.
Parts needed:
| ||
1 | Double-click on the Arduino icon to start the Arduino IDE program.
Click here for fast track, or continue on to step 2. | |
2 | Create a new program by selecting File from the menu
| |
3 | You will see this Bare Minimum template.
Commands that you put inside the "Inside" means between the two curly brackets { and }. Commands that you put inside the Lines starting with the two slashed // are comments, and they are ignored by the computer. | |
4 | There is a built-in light (LED) on the Arduino board that is connected to digital I/O pin 13. | |
5 | To control the LED we need to issue two commands to the Arduino:
First, we use the Second, we use the Type in these two commands inside the | |
6 | Connect your Arduino board to your computer using the USB cable. | |
7 | From the Arduino IDE program menu, select Tools
| |
8 | Press the upload button to upload the program onto the Arduino board. | |
If the upload is successful you should see the words Done uploading at the bottom, and the Arduino will automatically run the program. You should see the LED on the Arduino board turned on. | ||
If you have selected the wrong COM port or if there are errors in your program, you will see an orange error message at the bottom. You'll have to correct the error(s) and then upload your program again. | ||
9 | To make the LED blink, we need to turn on and then turn off the LED.
To turn off the LED, we use another | |
10 | Upload the program again. Did you see the LED blink? --- NO
You only see the LED off because the Arduino executed the two | |
11 | To keep the LED on a little longer so that you can see it, we need to use the
The number specified in the 1000 ms = 1 sec | |
12 | Upload the program again. What do you see? --- The LED turns on for 1 second and then it turns off. | |
13 | To make the LED blink continuously, we need to keep repeating the on and off sequence.
To do that, you move the two | |
14 | Upload the program again. What do you see? --- The LED just stays on. Why? | |
15 | We need another
| |
16 | Upload the program again. This time you'll see the LED blink on for 1 second and then off for 1 second.
Congratulations! You've completed your first Arduino project to make a LED blink! Now click on the Experiments button below to test yourself. After you have finished the experiments, come back here and click on the Next Project button to learn how to make music in the next project. | |