• --- cont ---

    Now, I had an external EEPROM in use which required I2C and SPI was in use for corresponding MOSI MISO comm. That left mw with D4 GPIO2 which is also the onboard LED which I wanted to avoid, D0 GPIO16 which might be needed for deep sleep and D3 GPIO0.

    When I used const neo = NodeMCU.D3; // GPIO0 the pinMode would always remain at D0 when using dump() to reveal.

    Checking:

    https://github.com/espruino/Espruino/blo­b/master/targets/esp8266/jswrap_nodemcu.­c

    reveals that NodeMCU","name" : "D3" is required to access GPIO0 and "NodeMCU","name" : "D0" to access GPIO16

    When using digitalWrite() NodeMCU.D3 works as desired when referencing pin labeled 'D3' which is GPIO0. However, when using 'D0' GPIO16 or NodeMCU.D0 or NodeMCU.D16 (in case they were backwards)
    always results in error: 'Uncaught Error: Invalid pin'

    Checking using dump() shows that in either case, the referenced pin is always 'D0' despite trying to force a known state.

    I did find a note: 'GPIO16 is now supported in Espruino as a D16 without watch but with all software functiontions like PWM/I2C/SPI/etc' at:

    https://www.espruino.com/EspruinoESP8266­

    but, for which version(s)?



    So, the mfg docs imply GPIO16 is a general purpose I/O for pin D0, but it appears it is just an input. (can anyone verify?)



    --- more ---

About

Avatar for Robin @Robin started