• Hi Robin,

    mode is a string, so use 'input_pullup'

    pinMode(D4, 'input_pullup');
    

    or set input_pullup

    input_pullup = 'input_pullup';
    pinMode(D4, input_pullup);
    
  • Thr 2017.02.02

    Good catch. I must have had a senior moment. That saved me a few hours of hair pulling of whats left. Thank you @MaBe

    I knew I had seen the syntax on this site without the quotes, but I must admit I missed this from the Espruino Reference page

    mode - The mode - a string that is either . . .

    mind stuck in 'why doesn't this argument work now' mode and just didn't get back into gear for the basics. It should have dawned on me to create a variable from the literal to become compiler compliant. nasty accuracy checker. ;-)

    Note: digitalRead/digitalWrite/etc set the pin mode automatically unless pinMode has been called first.

    Now with the syntax corrected, this error pops up for the 'input_pulldown' on the ESP8266

    ERROR: Pin state not supported
    

    This only occurs on pulldown but pullup functions as expected.

    Since I haven't seen documentation detail on 'input_pulldown' for the ESP8266, may I AssUMe that the Espruino Reference documentation is for Espruino boards only; the compiler is accurate and that the ESP8266 module doesn't have this feature available?

About

Avatar for MaBe @MaBe started