DISCO LED ARDUINO UNO R3

by sidiqul_akbar in Circuits > Arduino

2 Views, 0 Favorites, 0 Comments

DISCO LED ARDUINO UNO R3

Gemini_Generated_Image_6sqndx6sqndx6sqn.png

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

ITEMS REQUIRED.png
  1. 1 x Arduino Board (Uno, Nano, or Mega)
  2. 9 x LEDs (Mix colors for the best effect)
  3. 9 x 220Ω Resistors
  4. 1 x Breadboard
  5. Jumper Wires

Wiring (Pins 1–9)

DISCO LED CONNECTION.png

1. Wiring (Pins 1–9)

  1. Connect the short leg (Cathode) of all 9 LEDs to the common GND rail.
  2. Connect the long leg (Anode) of each LED to its own 220Ω resistor.
  3. 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

  1. Copy the code below into your Arduino IDE.
  2. Tip: Unplug the wire from Pin 1 while clicking "Upload," then plug it back in once finished to avoid communication errors.


How to Add More LEDs Later

How to Add More LEDs Later

  1. Update the Array: Add the new pin numbers to int ledPins[].
  2. Update pinCount: Change the number to match your new total.
  3. Find the Middle: For the centerExpand pattern, the middle index is always (pinCount - 1) / 2. (Example: For 11 LEDs, the middle is index 5).