Reading the status of the pin turns it into an input. You can force it with pinMode(Relay_pin,"output") but honestly I'd just store the current status of the pin in a variable - it's much easier.
Reading pin state isn't as easy as you'd think - if the pin was shorted then reading the value would always return 0 even though you might have set the output to 1
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.
Reading the status of the pin turns it into an input. You can force it with
pinMode(Relay_pin,"output")
but honestly I'd just store the current status of the pin in a variable - it's much easier.Reading pin state isn't as easy as you'd think - if the pin was shorted then reading the value would always return 0 even though you might have set the output to 1