I have some problems with Wemos D1 pins. I've got working only 2 pins.
Like this: #define ONE_WIRE_BUS 5 // this works on D3 (or is it D15, confusing markings on board, see the image) #define ONE_WIRE_BUS 4 // this works on D4
Others than those 5 and 4, I cant find, cant figure out pins for those.
The WeMos D1 and some other ESP8266 boards are a bit different than other Arduino boards in that their pin numbers refer to the GPIO numbers but the labels you see on the silkscreen don't match the GPIO numbers (I guess because the board layout would have made the numbering non-consectutive). The solution is to simply use the Dn notation, just as written on the silkscreen, to refer to the pins. For example:
pert:
The WeMos D1 and some other ESP8266 boards are a bit different than other Arduino boards in that their pin numbers refer to the GPIO numbers but the labels you see on the silkscreen don't match the GPIO numbers (I guess because the board layout would have made the numbering non-consectutive). The solution is to simply use the Dn notation, just as written on the silkscreen, to refer to the pins. For example:
#define ONE_WIRE_BUS D3
digitalWrite(D2, HIGH);
Thanks pert! I will try to write the code in that way.
on referred picture the labels close to pins are irrelevant. those are the uno labels.
you must use the left Dx labels. the gpio markings for rx and tx are wrong, there are io 1 and io 3.
btw: io pins on esp8266 are not called gpio (general purpose), because some of them have constraints on boot state
Hi mates, I have trouble, I can't find corrispondence from pin declared on Arduino IDE and hardware pin on board.
Are you so kind to draw it on the picture? (so there will not be possible misunderstandigs), thank you a lot!
For example i need to know which is:
pinMode(13,OUTPUT);
Please also tell me which is the corrispondent output pin of pinMode(LED_BUILTIN,OUTPUT);
I see that LED_BUILTIN is phisicalli connected to pin D9/TX (what is written on the board), but if I write on pin9 (digitalWrite(9,HIGH); for example) I don't have the seme effect than digitalWrite(LED_BUILTIN,HIGH);
pert:
The WeMos D1 and some other ESP8266 boards are a bit different than other Arduino boards in that their pin numbers refer to the GPIO numbers but the labels you see on the silkscreen don't match the GPIO numbers (I guess because the board layout would have made the numbering non-consectutive). The solution is to simply use the Dn notation, just as written on the silkscreen, to refer to the pins. For example:
My understanding is that digitalWrite(D9,HIGH) refers to the pin marked D9, but digitalWrite(9,HIGH) refers to GPIO 9, which is not actually usable because it's one of the pins used to communicate with the flash chip. That is, unlike a normal Arduino, D9 and 9 are not the same pin.
For bad reasons, the NodeMCU people started this alternate pin mapping that uses different numbers than the GPIO's are numbered. Wemos followed this convention in their silkscreen. Everyone else uses the GPIO numbers.
Thank you all for answers!
Ok now it works, but it's strange, I declared all lines from D13 to D5 output and I?m having this:
WHen D13 is low also D5 goes low, and viceversa, like pins are connected together
also D7 and D11
and D12 with D6
GiovanniG11:
Thank you all for answers!
Ok now it works, but it's strange, I declared all lines from D13 to D5 output and I?m having this:
WHen D13 is low also D5 goes low, and viceversa, like pins are connected together
also D7 and D11
and D12 with D6
Is it normal?
Thank you
the pinout of D1 R1 is strange. R2 has it like NodeMcu
GiovanniG11:
Ok can be strange, but why (for exmple) D13 and D5 command activate both two ports? Amazing..
Other way to test outputs?
because it is strange. but it has it's logic:
the SPI pins of esp8266 are mapped to pins where SPI is on Uno (D10, D11, D12, D13). but then no enough pins would be left for the first section of D pins.
and 4 and 5 as default I2C pins in esp8266 Wire library. they are connected to I2C pins SDA and SCL where they should be for shields (on the header next to usb connector). they are on Uno twice too (A4 and A5)
Thank you a lot for explaining!
If it is like that we have (at least I counted now 3) some outputs which are electrically connected to 2 din bars, the result is a limited amount of input outputs available (duplicated are useless).
I was thinking more compatible with integrated wi fi, few lines, only one analog, I'm a bit dispappointed, I go to buy a real UNO clone with 328p )
I now managed to get mine working after alot of try and error to figure out the pinout but with the pinout that you provided on previous post really helped me alot. Thank you Juraj.