- Upload Sketch
- Program Running Result
In this lesson we will realize the function of eight of flowing water light, from left to right, each only light one LED,reciprocating cycle.
- Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
- Breadboard x 1
- LED x 8
- 200 ohm resistor x 8
- M/M jumper x 20
- USB Cable x 1
- PC x 1
Arduino IDE (version 1.6.4+)
You can wiring your hardware as below :
Why do I empty 0 and 1 and two interfaces? These two interfaces actually use as the board's serial ports, TX and Rx, that is to say, if you connect led on these two interfaces, you can't download the normal program. So, generally we will empty out, if must use the case, you need to download a good program first, and then connect the circuit.
You cannot directly connect an LED to a battery or voltage source. Firstly, because the LED has a positive and a negative lead and will not light if they are the wrong way around and secondly, an LED must be used with a resistor to limit or 'choke' the amount of current flowing through the LED - otherwise the LED could burn out!
If you have connected the wiring diagram, connect the Arduino Uno board to your computer using the USB cable. The green power LED (labelled PWR
) should go on.
Open the Arduino IDE,and choose the corresponding board type and port type for your Arduino，then open the sketch
or copy below code to your IDE window:
for (int i=2; i<=9; i++) //Set the pin2~pin8 cycle output
for (int x=2; x<=9; x++) //Each LED will flash in one second
Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar.
A few seconds after the upload finishes, you should realize the function of eight of flowing water light, from left to right, each only light one LED,reciprocating cycle
. If it does, congratulations! You've gotten Arduino up-and-running.