I recently bought a Chinese clone of the Lolin Wemos D1 Mini Pro ESP8266 device from the FEIYANG store at AliExpress. As I had problems running Wifi when setting the original Lolin Wemos D1 Mini Pro
in the board manager, I resorted to General ESP8266
.
The downside is that the General ESP8266
board definition offers fewer pin defines. While constants like LED_BUILTIN
work out of the box, using the common constant D4
for that very same pin fails with the compiler complaining that an undefined constant has been used.
Therefore we have to define the pins ourselves in the code. Here’s a table that I found on the Chris Chewett’s blog.
Wemos Labels | Arduino IDE | Remarks |
D0 | 16 | |
D1 | 5 | Usually driving pin for relay shield. |
D2 | 4 | |
D3 | 0 | |
D4 | 2 | LED_BUILTIN works as constant,Note that onboard LED will light up when pin is LOW and is dark when pin is HIGH . |
D5 | 14 | |
D6 | 12 | |
D7 | 13 | |
D8 | 15 | |
TX | 1 | |
RX | 3 | |
A0 | 17 | A0 seems to work as a constant. No need to set pinMode to anything according to this code example. |