Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Aresby
#42488 So back to fundamentals:

When I load the BLINK program, which I've had to change to use the LED_BUILTIN constant to get a blinking LED (which refers to pin 2) the actual pin on the D1 board is TX1/D9. :|

Underneath the board is printed GPIO2 for that pin. :roll:

So I'll write a quick sketch to set each pin HIGH and use my multimeter to check that the GPIO number printed under the board refers to the digitalWrite(PIN...) that I'm using.

Then I'll see about getting my original program (that caused the RST) to run.
User avatar
By Aresby
#42491 Finally I got it sorted thanks to you guys pointing me to the pin-mapping issue.

The ESP8266 D1 has only a FEW PINS available for general use (ie using digitalWrite(PIN...).

pin 2 maps to TX1/D9
pin 4 maps to D14/SDA/D4
pin 5 maps to D15/SCL/D3
pin 12 maps to D12/MISO
pin 13 maps to D11/MOSI
pin 14 maps to D14/SCK
pin 15 maps to D10/SS

When I write "pin" above I am referring to the actual GPIO, which is printed under the board too (so not very useful having it there).

Some pins are duplicated:

pin 14 also maps to D13 / SCK/D5
pin 12 also maps to D12 / MISO /D6
pin 13 also maps to D11 / MOSI / D7
(there may be others)

As this board is now deprecated I wonder if they have improved the number of pins available on the R2 version?

Anyway, I now have my LED Matrix sketch running on the D1 (lucky I didn't need more pins!) which is not what it is going to be used for but proves that it at least runs Arduino code as it should. No more RSTs :D

Thanks again guys!
User avatar
By roboticboyer
#42801 I have attached the pin diagrams of the WeMos D1 version R1 and R2 .
The two boards are not pin to pin compatible

My understanding is that only the R2 version has the pins Dx named as NodeMCU v0.9 kit
You do not have the required permissions to view the files attached to this post.
User avatar
By Simple Simon
#42802 I've got a WeMos D1R2. The SCK LED is pin 5.
The pin 4 LED (on the chip) is "backwards" from the other pins.

Also, you need to make sure you set OUTPUT mode before setting it on or off.
Hook the pin to a 1K resistor, then to the anode, and cathode to ground.
That works for me.