Step 1: Connecting Power and Ground
Start by connecting 5V and GND pins on the Arduino to the 5 volt and ground rails on the breadboard.
Connect the voltage rails on the breadboard to the 5V and GND pins.
Continue to the next step.
Step 2: Arrange and Connect LEDs
Next, arrange the 6 LEDs in a bar graph formation, giving each of them their own digital pin (2 through 7).
- Arrange the 6 LEDs in a line on row E on the breadboard.
- Using the picture as a guide, connect the anodes (long, right legs) of the LEDs to digital pins 2 through 7.
- Connect the cathode (short, left leg) of each LED to ground through a 220 ohm resistor.
- Continue to the next step.
- Stuck? HINT: You don't need to individually set the resistance of each resistor by highlighting it and using the dropdown menu. Simply create one 220 ohm resistor and copy/paste it 5 times using CONTROL-C and CONTROL-V key strokes.
Step 3: Add the Tilt Sensor
Now we'll add the tilt sensor to the breadboard.
- Open the component try (by clicking + Components) and select the tilt sensor 4-pin under All Components.
- Place the sensor on the breadboard to the left of the LEDs, as shown in the picture.
- Connect one side of the tilt switch to the 5 volt rail with a wire.
- Connect the other side to ground through a 10 k-ohm resistor.
- Connect the terminal where the sensor and resistor meet to digital pin 8.
- Continue to the nest lesson to learn how to write the Digital Hourglass code.
Next Lesson:Writing the Code