
Driving Multiple LEDs — SIK Circuit 4
Amabwiriza
Parts & Introduction
Parts & Introduction
This experiment uses 8 LEDs to create light patterns. You'll learn about arrays (grouping related variables) and for loops (repeating actions efficiently). The sketch includes 6 different animation functions you can try.
Parts Needed
- 1x Arduino Uno + USB cable
- 1x Breadboard
- 8x LEDs (any color)
- 8x 330Ω Resistors
- 9x Jumper Wires
Ibikoresho by'iyi ntambwe:
SparkFun Inventor's Kit - V3.21 ibikoreshoIbikoresho bikenewe:
Computer with Arduino IDEHardware Hookup
Hardware Hookup
Wiring Instructions
- Place 8 LEDs in a row on the breadboard.
- For each LED, connect the negative leg (shorter) through a 330Ω resistor to GND.
- Connect the positive leg (longer) of each LED to Arduino digital pins 2 through 9 (LED 1 = pin 2, LED 2 = pin 3, etc.).
- Connect the GND rail on the breadboard to Arduino GND.
Tip: Keep the LEDs neatly spaced for the best visual effect.
Ibikoresho by'iyi ntambwe:
Breadboard1 igice
Jumper Wires9 ibiceArduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
Ibikoresho by'iyi ntambwe:
Arduino Uno R31 igiceIbikoresho bikenewe:
Computer with Arduino IDETest & Experiment
Test & Experiment
What You Should See
All 8 LEDs light up one after another, then turn off in reverse order. This repeats continuously.
Troubleshooting
- Some LEDs don't light: Easy to insert an LED backwards. Check polarity.
- Out of sequence: With 8 wires, it's easy to cross a couple. Verify LED 1 is on pin 2, then each pin in order.
- Starting fresh: Sometimes pulling everything out and re-wiring is faster than debugging.
Experiments to Try
- Uncomment the other functions in
loop()to try:oneOnAtATime(),pingPong(),marquee(),randomLED(). - Create your own animation pattern!
- Modify the delay times to change the speed.
Ibikoresho
6- SparkFun Inventor's Kit - V3.210% komisiyo1 ibikoresho$105.94
- guhera kuri$9.50
- guhera kuri$4.16
- guhera kuri$27.06
- 8 ibiceUmwanya
Ibikoresho bikenewe
1- Umwanya
CC0 Umurenge rusange
Iyi blueprint yasohowe munsi ya CC0. Ushobora gukoporora, guhindura, gukwirakwiza no gukoresha nta kwemererwa.
Shyigikira Umuremyi ugura ibicuruzwa binyuze muri Blueprint ye Komisiyo y'Umuremyi byashyizweho n'Abacuruzi, cyangwa kora verisiyo nshya y'iyi Blueprint ukayinjiza nk'isano muri Blueprint yawe kugira ngo musangire inyungu.