Connect 3 LEDs and Blink Them in Sequence

PR0 Challenge 5.6 [30pts]

omnignorant


Your goal is to add 3 LEDs and make them all blink, but not at the same time! Each one should blink on its own in a sequence that you can adjust. Try to do this one without any help based on what you did in 5.5.


STEP 1: Parts

To carry out the experiment described in this lesson, you will need the following parts.

3 5mm Red LED led_red_5mm
1 100Ω Resistor (brown, black, brown) 10ohm_resistor

STEP 2: Breadboard Layout

Connect up your stripboard as shown below, using the 100Ω resistor.

3leds_arduino_fritzing

STEP 3: Blinking the LEDs

First

Modify the Blink code from Challenge 5.5 to make all three LEDs blink on and off at the same time;

Second

Modify the Blink code from Challenge 5.5 to make the three LEDs turn on in sequence, one after the other, until all three are on, then turn off in sequence, until all three are off;

Third

Make the LEDs count in binary!. Each LED will represent a digit.

  • What is the value of the LED-digit when the LED is off? When it is on?
  • How many numbers can you represent with the 3 LEDs and how high can you count?
  • How many LEDs would you need to count to 100?

STEP 4: Save your Code GitHub!

cd ~/scholar-work-open
git branch
git checkout your-branch-name
git add *
git commit -a -m 'Hackshop Challenge 5.6'
git push origin your-branch-name