diff --git a/nodes/core/hardware/35-arduino.js b/nodes/core/hardware/35-arduino.js index 5f9d36701..8b4ba19bc 100644 --- a/nodes/core/hardware/35-arduino.js +++ b/nodes/core/hardware/35-arduino.js @@ -121,10 +121,10 @@ module.exports = function(RED) { node.board.pinMode(node.pin, node.state); node.on("input", function(msg) { if (node.state === "OUTPUT") { - if ((msg.payload === true)||(msg.payload == 1)||(msg.payload.toString().toLowerCase() == "on")) { + if ((msg.payload === true)||(msg.payload.toString() == 1)||(msg.payload.toString().toLowerCase() == "on")) { node.board.digitalWrite(node.pin, true); } - if ((msg.payload === false)||(msg.payload === 0)||(msg.payload.toString().toLowerCase() == "off")) { + if ((msg.payload === false)||(msg.payload.toString() == 0)||(msg.payload.toString().toLowerCase() == "off")) { node.board.digitalWrite(node.pin, false); } }