Introduction: LED Control Final
In this tutorial, you will learn how to control a row of 5 LEDs with a potentiometer. The potentiometer will fade between the LEDs as it looks in the example diagram.
Step 1: Attach 5 LEDs
Attach 5 LEDs to the breadboard and then connect them to the Arduino.
1. Attach a wire from the ground column on the breadboard to the ground on the Arduino
2. Insert LED into breadboard
3. Attach wire from the cathode of the LED (Shorter Side) to the ground rail of the breadboard
4. Attach a resistor from the anode of the LED (Longer Side) to pin 11 on the Arduino
5. Repeat steps 2-4, but make sure to connect the remaining LEDs attach to pins 10, 9, 6, and 5.
Attaching to pins with PWM is necessary to dim the light bulbs
Step 2: Attach a Potentiometer
Attach a potentiometer to control which lights are lit.
1. Attach the potentiometer as shown.
2. Attach a wire from the left pin of the potentiometer to the power rail on the breadboard.
3. Attach a wire from the middle pin on the potentiometer to the A0 pin on the Arduino.
4. Attach a wire from the right pin on the potentiometer to the ground rail of the breadboard.
5. Attach a wire from the power rail of the breadboard to the 5V pin on the Arduino.
Step 3: Run the Code Provided With This Tutorial
Run the LEDControlFinal.ino file in the Arduino IDE. This should allow you to fade between the LEDs.