void setup() {
pinMode(2, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH);
delay(1000);
digitalWrite(2, LOW);
delay(1000);
}
In NodeMCU, GPIO2 is mapped to D4 and is connected to the built-in LED. This means that when you use GPIO2 for other purposes, the built-in LED will be affected, as it shares the same pin.
In ESP-01, GPIO2 controls the built-in LED. When you use GPIO2 for other tasks, the built-in LED will be impacted, since it's connected to the same pin.
NodeMCU ESP-01
06 Nov. 2024
|
Last Updated: 22 Nov. 2025
|
jaimedcsilva Related