This example blinks an external LED connected to the D0 pin of the NodeMCU.
void setup() {
pinMode(D0, OUTPUT);
}
void loop() {
digitalWrite(D0, HIGH);
delay(1000);
digitalWrite(D0, LOW);
delay(1000);
}
The LED is connected to D0 through a resistor (100–220Ω) and then to ground.
External LED NodeMCU circuit
Compatible with: NodeMCU