0% found this document useful (0 votes)
3 views2 pages

Arduino Lesson 4-Advertising Light

This document outlines an Arduino lesson focused on creating an advertising light effect using 6 LEDs. It includes a list of required parts, connection instructions, and a sample program to control the LEDs. The program demonstrates how to turn the LEDs on and off in a sequence with delays to create a gradual lighting effect.

Uploaded by

maisecinos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Arduino Lesson 4-Advertising Light

This document outlines an Arduino lesson focused on creating an advertising light effect using 6 LEDs. It includes a list of required parts, connection instructions, and a sample program to control the LEDs. The program demonstrates how to turn the LEDs on and off in a sequence with delays to create a gradual lighting effect.

Uploaded by

maisecinos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Arduino Lesson 4

Advertising light
We often see some billboards, composed of all sorts of color of the led
lamp constantly change. This experiment will show you the basic effects.
1)Parts require
Leds:6
220Ω Resistor:6
Jumper Wires:1 Bundle
2)Connection
Put 6 leds on pins in order as below

 Program for reference


int BASE = 2 ; //First LED I/O contact
int NUM = 6; //LED Numbers
void setup()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
pinMode(i, OUTPUT); // Setup digital I/O as output
}
}
void loop()
{
for (int i = BASE; i < BASE + NUM; i ++)
{
digitalWrite(i, LOW); // Setup digital I/O output as “low” which means turn on
the light gradually
delay(200); //Delay
}
for (int i = BASE; i < BASE + NUM; i ++)
{
digitalWrite(i, HIGH); //Setup digital I/O output as “low” which means turn on
the light gradually
delay(200); //Delay
}
}

You might also like