Reading a pin is not a read-only operation. So I check if LED1 is on and it returns 1 meaning yes. Except it's not any more, LED1 is off now.
Could you tell a bit more about the reasoning for this? I'm just trying to make sense of it.
Reading pinMode documentation with its eight possible values is a bit rough. Do I have to know pullup, opendrain and the difference between "output" and "af_output" just to play around with LED1 like in op example?
I really admire Espruino's API and find it superior to other things I've tried, but this one seems like NaN in JS - weird.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Oh dear I find it so confusing :)
Reading a pin is not a read-only operation. So I check if LED1 is on and it returns 1 meaning yes. Except it's not any more, LED1 is off now.
Could you tell a bit more about the reasoning for this? I'm just trying to make sense of it.
Reading pinMode documentation with its eight possible values is a bit rough. Do I have to know pullup, opendrain and the difference between "output" and "af_output" just to play around with LED1 like in op example?
I really admire Espruino's API and find it superior to other things I've tried, but this one seems like NaN in JS - weird.