Assignment #6 -
Christmas Lights - Arduino
In Class We'll Discuss:
Pulse Width Modulation Dimming: Link to Reference:
Adjusting the time on and time off to affect apparent brightness
For-Loops Link to Reference:
for (int x=1; x<26; x++)
{
<code you want repeated>
}
Do While Loops Link to Reference:
x=1;
do
{
<code you want repeated>
x = x+1;
} while (x < 26);
While Loops Link to Reference:
while (x < 26)
{
<code you want repeated>
x = x+1;
}
x=1;
Make a 30 second repeating Christmas Star Routine:
- include dimming
Pin3 - Output (outer green star)
Pin5 - Output (middle red star)
Pin6 - Output (inner blue star)
Pins 3,5,and 6 were used because they are PWM capable outputs.
Wire 3 LEDs - 1 to each of pins 3,5,6 with current limiting resistors to test your code. (Note the wiring for the Stop Light and change to pins 3,5,6)