You are reading a single comment by @AkosLukacs and its replies. Click here to read the full conversation.
  • Thanks for the explanation, so it's expected and by design?

    But that means, that a couple of libraries that support optional pins, just "accidentally" work? IIRC in most cases the check is usually if(options.whateverPin){...}
    For example in the CCS811, it's

    if (ccs.options.int) {
    ...
    

    Thinking back, I may have had an issue with A0 on the Pixl, but just moved to another pin without thinking too much. Or maybe not :)

    Consistency with JS I think usually would be beneficial, for example setting the length of an array in a browser empties that array. But creates a length property with value of 0 in Espruino :)

    Don't know how much work would be to add a special handling from Pin to bool.

About

Avatar for AkosLukacs @AkosLukacs started