• Sat 2020.09.19

    Thank you for the link @bk, now we are on the same page. On a hunch, it appears the onboard LED is being used??

    While this isn't your particular board, several manufactures, including the knock-offs may have a slightly different PCB routing, there may be some insight garnered from the sister Espruino WiFi schematic from the link at:

    which leads to:

    Note how the Red and Green LEDs for the Espruino are wired to it's pins in comparrison to how the ESP12 Blue LED is wired to Vdd. Should the board you have be wired in this fashion, the use of digitalWrite() would have to be inverted

    Also, when reading the reference: (and I had to learn this after quite some time)


    please note the Right Facing arrow adjacent to the heading 'digitalWrite' which when clicked, takes one to the source:


    I had hoped to locate the definition for LED1, but my configured PC that had easy access isn't at my disposal, and I wasn't able to quickly locate the file, but it most likely is within:


    The intent was to show how in source that snippet funtioned for the defined LEDs with official boards.

    I did however locate a tutorial that was for the Pico (~circa 2017) that demonstrates what (then) was the suggested snippet for the onboard LED, which is slightly different than using digitalWrite() with an off-board LED. Maybe that will clear up a bit of the confusion.


    Ref: 'it seems to be a bit weird that on . . . LED does gets turned off'

    See explanation #7 post and onboard vs off-board above

    digitalWrite() is an instruction to set the specified GPIO pin to a specific state. As the controlled device is unknwon before the code (that you will create) is written, it can't be Ass-U-Me'd that the unknown device is an LED or how it is wired. It could just as easily be a GPS module or a Temperature sensor, for instance.


Avatar for Robin @Robin started