Arduino LED Circuit: Wiring and Code for Beginners
Every circuit starts with one light. Send power from pin 13 through a resistor to the LED and switch it on.
Parts you need
- Arduino Uno
- Red LED
- 220Ω resistor
Wiring
- Pin 13 → resistor → LED long leg
- LED short leg → GND rail
Arduino code
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
}
void loop() {
// nothing to repeat
}
Goal and tip
Goal: Make the LED glow.
Tip: Try this: change HIGH to LOW and run again. What happens?