Project #3: Flowing LED
Let us now conduct a simple yet interesting experiment: using LEDs to create flowing LED lights. As the name suggests, these eight LEDs in a row successively light up and dim one after another, just like flowing water.
The principle of this experiment is simply to turn on eight LEDs in turn. The eight LEDs are connected to pin 2-pin 9 respectively. Set them as High level and the corresponding LED at the pins will light up. Control the time of each LED brightening and you will see flowing LED lights.
Components Uno board, Breadboard, Eight L.E.Ds, Eight Resistor (220Ω), One USB cable,
Step 1: Build the circuit
Step 2: Type in the code as shown in video above
Step 3: Select the Board and Port
Step 4: Upload the sketch to the Uno board
Now, you should see eight LEDs brighten one by one from the LED connected to pin 2 to that to pin 9, and then dim in turn from the LED at pin 9 to the one at pin 2. After that, the LEDs will light up from the LED at pin 9 to that at pin 2 and dim from the LED at pin 2 to that at pin 9. This whole process will repeat until the circuit is powered off.