Building the running lights project
Uda Make digital output with different levels
In this lesson we will use digital output pins 3, 5,6, 10 and 11. These pins will each send a 1 or 0 to the LEDs connected to them.
Pin D3 will send ON and OFF to Green LED.
Pin D5 will send ON and OFF to Orange LED.
Pin D6 will send ON and OFF to Blue LED.
Pin D10 will send ON and OFF to Yellow LED.
Pin D11 will send ON and OFF to Red LED.
Let’s build it;
- Place the resistor 1 and the Green LED on the breadboard as shown in the illustration.
- Connector a jumper wire between port 3 labelled as D3 and one side of the resistor.
- Put a breadboard wire between the other side of the resistor and the anode of the red LED.
- Connect a jumper wire between cathode of the Green LED and GND line on the power rail at the bottom. The power rail is connected to the GND port using a jumper
- Repeat the process by connecting Orange LED through a resistor to port D5 and to GND line.
- Blue LED through a resistor to port D6 and to GND line.
- Yellow LED through a resistor to port D6 and to GND line.
- Red LED through a resistor to port D6 and to GND line.
It’s time to run the project
- Open projects.
- Select project 2 – Running Lights.
- If the Kit is powered off, power it on.
- Press center key to upload.
- On the upload dialog box, press the left key to upload.
- The project should run after upload is 100% complete.
Watch this video on how to make.
What did you observe?
Once the project has uploaded and running, you will observe that the LEDs will flash on and off starting with the green LED, then the orange, blue, yellow and red. The LEDs will flash on and off repeatedly as long as the power is on. The process will repeat to the next LED until it reaches the green LED and then repeats again.
For the LEDs to flash on and off, the positive leg of the green LED is attached to D3, which is the digital output pin. Our small portable computer, Unda Make sends the first instruction to turn the voltage high, turning the green LED on and the second instruction to turn the voltage low, turning the LED off.
The same instruction is repeated to the orange LED connected to D5, blue LED connected to D6, yellow LED to D10 and red LED to D11.This instruction repeats again from the start, which is green and this repeats again and again.
The turning ON and OFF of the LED creates a running light effect, that is like the LEDs are chasing each other. Unda Make small computer is used to controls the LEDs switch timing and cycle.
A digital loop is used to give instructions of how many times to repeat the ON and OFF instruction.