I know its not the sketch. I asked an 8 year old, and we're agreed. its not the sketch.
I tried changing the pin from D0 to D3 and wiring an LED with a R330 in series (its lights during the upload too) but did not get blinky to work there either.
I've tried several other boards listed, including three LoLin's and one WeMo's
Hi, please read the forum guide in the sticky post. There you can learn how to post code and images correctly and what else to include in your post so that we can help you.
thank you for your reply,
I'm not sure which post in what sticky guide I'm supposed to read but I put a link to an image between (img)(/img) (round brackets instead of square here so you can see them) hypertext markers and they're still there but the picture doesn't appear.
(pre)(/pre) for the code and I'm not sure why that's an issue.
getting back to my question ...
I've tried pinMode() and digitalWrite(HIGH/LOW) for all the pins and surprisingly this works in different combinations but not others. sometimes I'll see pin2 blinking when its not even included in the list of pins to be toggled HIGH/LOW. other times none of them work although the same combinations that work once work a second and third time...?!? its a little odd. this seems like odd behaviour to me.
Christ Kennedy
The tricky thing about some ESP8266 boards is that the ESP8266 core for Arduino platform uses the GPIO numbers for the IO functions like digitalWrite(), but the pin labels written on the board don't match the GPIO numbers. So there are constants defined for these boards that map the pin labels on the board to the GPIO numbers. For example, here are the mappings for the WeMos/LOLIN D1 Mini board:
So if your LED is connected to the pin on the board marked "D0", this code:
const int pinLED = 0;
is incorrect. Instead, it should be:
const int pinLED = D0;
It could also be:
const int pinLED = 16;
but then you need to remember the mapping. Much easier to just use the pin numbers marked on the board.
This is confusing because we're used to being able to use normal integers to identify the digital pins on our Arduino boards. I had the same confusion as you the first time I used an ESP8266.
Note that this was only an example, which applies to the D1 Mini board. Your board may have a different pin mapping. You need to select the correct board from the Arduino IDE's Tools > Board menu in order for the pin mapping to match the labels on the board. Your images are not shared publicly, so there is no way for us to provide guidance regarding which board you need to select.
thank you for your post,
I jumped out of my seat and straight to my desk when I read.
you really had my hopes up(and I was going to rag on that 8 year old for telling me my code was ok)