DISCO LED ARDUINO UNO R3
9-LED Custom Disco Light Show
This setup uses 9 LEDs connected to Pins 1 through 9. Since 9 is an odd number, the "Expand" pattern uses the middle LED as a starting point to create a perfect symmetrical pulse.
Supplies
- 1 x Arduino Board (Uno, Nano, or Mega)
- 9 x LEDs (Mix colors for the best effect)
- 9 x 220Ω Resistors
- 1 x Breadboard
- Jumper Wires
Wiring (Pins 1–9)
1. Wiring (Pins 1–9)
- Connect the short leg (Cathode) of all 9 LEDs to the common GND rail.
- Connect the long leg (Anode) of each LED to its own 220Ω resistor.
- Connect the other side of the resistors to Digital Pins 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Uploading the Code
2. Uploading the Code
- Copy the code below into your Arduino IDE.
- Tip: Unplug the wire from Pin 1 while clicking "Upload," then plug it back in once finished to avoid communication errors.
Downloads
How to Add More LEDs Later
How to Add More LEDs Later
- Update the Array: Add the new pin numbers to int ledPins[].
- Update pinCount: Change the number to match your new total.
- Find the Middle: For the centerExpand pattern, the middle index is always (pinCount - 1) / 2. (Example: For 11 LEDs, the middle is index 5).