Codey OnlineArduino- & ESP32-componentenbibliotheek › LED
LED
Output

LED

Standaard 5mm through-hole LED. Verkrijgbaar in rood, groen, blauw, geel, wit, oranje en warmwit. Heeft een stroombegrenzende weerstand nodig (meestal 220Ω voor 5V).

Pinout — LED

Pin Signaal Beschrijving
ANODE Positive lead (long leg, +)
CATHODE Negative lead (short leg, -)

Aansluittips

2-pins component. Gebruik componentId led met de kleur in het label (bijv. Red LED). Pinnen: ANODE (+, lang pootje), CATHODE (-, kort pootje). Gepolariseerd — ANODE moet aan de positieve kant worden aangesloten. Gebruik altijd een stroombegrenzende weerstand (220Ω voor 5V, 100Ω voor 3.3V).

Voorbeeld-aansluitschema — LED

Van Naar Draad
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

Voorbeeld-Arduinocode — LED

Dit voorbeeld is geschreven en compile-gecheckt voor de arduino-uno. Codey Online past het voor je aan naar elk ander ondersteund board.

// 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);
}

Vergelijkbare componenten

3W amplifier MAX98357A I2S DAC

3W amplifier MAX98357A I2S DAC

Active Buzzer Module

Active Buzzer Module

LED Matrix Module MAX7219

LED Matrix Module MAX7219

Passive Buzzer Module

Passive Buzzer Module

Bouw je Arduino- of ESP32-project met AI

Beschrijf wat je wilt bouwen. Codey Online schrijft de code, tekent het aansluitschema, compileert het en flasht je board rechtstreeks vanuit de browser.

Gratis starten