Standard 5mm through-hole LED. Available in red, green, blue, yellow, white, orange, and warm white. Requires a current-limiting resistor (typically 220Ω for 5V).
| Pin | Signal | Description |
|---|---|---|
ANODE |
Positive lead (long leg, +) | |
CATHODE |
Negative lead (short leg, -) |
2-pin component. Use componentId led with the color in the label (e.g. Red LED). Pins: ANODE (+, long leg), CATHODE (-, short leg). Polarized — ANODE must connect to the positive side. Always use a current-limiting resistor (220Ω for 5V, 100Ω for 3.3V).
| From | To | Wire |
|---|---|---|
board:D4 |
bb:E5 |
green |
r1:1 |
bb:A5 |
red |
r1:2 |
bb:A10 |
blue |
led1:ANODE |
bb:E10 |
yellow |
led1:CATHODE |
bb:E11 |
purple |
bb:B11 |
board:GND |
black |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
// Canonical LED example for Arduino Uno
// Blinks a red LED through a 220Ω resistor on digital pin 4.
const int ledPin = 4;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH); // LED on
delay(500);
digitalWrite(ledPin, LOW); // LED off
delay(500);
}
Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free