
Driving Multiple LEDs — SIK Circuit 4
Mga Tagubilin
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
Mga materyales para sa hakbang na ito:
SparkFun Inventor's Kit - V3.21 kitMga kailangang kasangkapan:
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.
Mga materyales para sa hakbang na ito:
Breadboard1 piraso
Jumper Wires9 pirasoArduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
Mga materyales para sa hakbang na ito:
Arduino Uno R31 pirasoMga kailangang kasangkapan:
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.
Mga Materyales
6- SparkFun Inventor's Kit - V3.210% komisyon1 kit$105.94
- mula sa$9.50
- mula sa$4.16
- mula sa$27.06
- 8 pirasoPlaceholder
Mga Kinakailangang Kasangkapan
1- Placeholder
CC0 Pampublikong Domain
Ang blueprint na ito ay inilabas sa ilalim ng CC0. Malaya kang kumopya, magbago, mamahagi, at gumamit nang walang pahintulot.
Suportahan ang Maker sa pamamagitan ng pagbili ng mga produkto sa kanilang Blueprint Komisyon ng Maker itinakda ng mga Vendor, o lumikha ng bagong bersyon ng Blueprint na ito at isama bilang koneksyon sa iyong Blueprint upang ibahagi ang kita.