I am using an ESP-01 wifi module with a USB serial programmer. The blink example does NOT work under vscode. I can compile and upload it without an error, but it does nothing. If I hover over the LED_BUILTIN, OUTPUT, HIGH or LOW words then I see them properly defined (eg: LED_BUILTIN = 1)
It can not be the USB serial programmer (or at least not directly), because the same code works perfectly under the standard arduino IDE.
I have tested the same code with an Arduino UNO just to make sure that it is not the serial programmer of the ESP-01 causing the problem. No it’s not!
The blink code doesn’t work with an Arduino UNO either!
Also checked under Atom, same results, as expected. Just for clarification: I can upload working codes to my ESP-01 using PIO, but it seems this very basic one doesn’t work. Also struggling with the serial monitor, but I’d like this to be resolved first.
Are you sure you have the correct board selected in your platform.ini? I was having a similar issue with mbed and an STM ST32 board. I was trying to blink the LED1 user LED. It turned out that the problem was that in my platform.ini, I specified disco_f746 (STM DISCOVERY board with an F746), but I was using a nucleo board instead of a discovery board, so all of the standard macros (including LED1) were wrong.
I guess this should be correct, because I am able to use PIO to upload other stuff to my ESP-01 (eg: controlling an OLED, connecting to wifi, reading html headers etc). The LED_BUILTIN is defined as 1 which is correct for my module.