Whilst working on an addition ontop of UART.js ive found that digitalRead(LED) will turn off LED is this a bug or intended?
That's intended - digitalRead automatically sets the pin state to input when you use it (in the same way you'd be surprised if digitalWrite didn't change the pin state to an output).
You can manually set the pin mode with pinMode though, and then it won't change state after that so you can do a digitalRead while leaving the LED on.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem