When I said about pin.read not being reliable, it's really because it depends what you actually connect the pin to.
pin.read
For one of those relay modules with the drive electronics, something like:
pinMode(pin,"output"); pin.write(!pin.read());
Will probably work fine. I still wouldn't recommend it though :)
@Gordon started
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.
When I said about
pin.read
not being reliable, it's really because it depends what you actually connect the pin to.For one of those relay modules with the drive electronics, something like:
Will probably work fine. I still wouldn't recommend it though :)