Skip to content

Instantly share code, notes, and snippets.

@GluTbl
Last active July 24, 2020 12:51
Show Gist options
  • Save GluTbl/c0c2eaa0ebd8df77fe4b357354d30f6a to your computer and use it in GitHub Desktop.
Save GluTbl/c0c2eaa0ebd8df77fe4b357354d30f6a to your computer and use it in GitHub Desktop.
[ESP8266 Pinout] Generic ESP8266 Module blinking inbuilt led #esp8226
///////Board Generic ESP8266 Module//////////
#define MY_BLUE_LED_PIN 1
void setup() {
pinMode(MY_BLUE_LED_PIN, OUTPUT); // Initialise the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(MY_BLUE_LED_PIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(MY_BLUE_LED_PIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
******************************FOR NODE MCU******************
void setup() {
pinMode(2, OUTPUT); // Initialize GPIO2 pin as an output
}
void loop() {
digitalWrite(2, LOW); // Turn the LED on by making the voltage LOW
delay(1000); // Wait for a second
digitalWrite(2, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds
}
Node MCU pinmap
D0- GPIO16
D1- GPIO5
D2- GPIO4
D3- GPIO0
D4- GPIO2
D5- GPIO14
D6- GPIO12
D7- GPIO13
D8- GPIO15
D9/RX- GPIO3
D10/TX- GPIO1
D11/SD2- GPIO9
D12/SD3- GPIO10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment