Lesson 5- Flowing Leds


Introduction

In this lesson, you will conduct a simple yet interesting experiment – using LEDs to create flowing LED lights. As the name implies, these flowing lights are made up of eight LEDs in a row which successively light up and dim one after another, just like flowing water.


Components

- 1 * SunFounder Uno board

- 1 * Breadboard

- Jumper wires

- 8 * LED

- 8 * Resistor (220Ω)

- 1 * USB cable


Principle

The principle of this experiment is simply to turn on eight LEDs in turn.

Experimental Procedures

Step 1: Build the circuit. (use the digital ports 2 till 9 for the leds)

Step 2: Program.

Use the code in the document below and copy/paste it into the Arduino Program on your computer:

Arduino Lesson 5

Step 3: Compile the code

Step 4: Upload the sketch to the SunFounder Uno board

Now, you should see eight LEDs brighten one by one from left to right, and then dim in turn from right to left. After that, the LEDs will light up from right to left and dim from left to right. This whole process will repeat until the circuit is power off.