D1 Mini - Arduino
Pin Def's
#define D0 16
#define D1 5
#define D2 4
#define D3 0
#define D4 2
#define D5 14
#define D6 12
#define D7 13
#define D8 15
#define A0 A0
#define RX 3
#define TX 1
Pin Mapping To ESP8266 Pin Numbers
| Wemos D1 | ESP8266 Pin | Functions |
|---|---|---|
D0 |
16 |
GPIO |
D1 |
5 |
GPIO, I2C SCL |
D2 |
4 |
GPIO, I2C SDA |
D3 |
0 |
GPIO |
D4 |
2 |
GPIO |
D5 |
14 |
GPIO, SPI SCK (Serial Clock) |
D6 |
12 |
GPIO, SPI MISO (Master in, Slave out) |
D7 |
13 |
GPIO, SPI MOSI (Master out, Slave in) |
D8 |
15 |
GPIO, SPI SS (Slave select) |
A0 |
A0 |
Analog in, via ADC |
RX |
3 |
Receive |
TX |
1 |
Transmit |
PWM Notes
ESP8266 allows software PWM in all I/O pins: GPIO0 to GPIO15. PWM signals on ESP8266 have 10-bit resolution
Min PWM value for motor that causes motor to stop running:
Around 65
Deep Sleep
# this sleeps for 5 seconds
ESP.deepSleep(5e6);
You have to connect pin D0 to RST, AFTER the code has been uploaded.
If they are connected while you upload code, it will be unsuccessful
LED_BUILTIN pin
D4 inverted