Skip to content

Commit

Permalink
Arduino pin values should be strings not numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Apr 15, 2015
1 parent d090df9 commit 78ab421
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/core/hardware/35-arduino.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.toString() == 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.toString() == 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);
}
}
Expand Down

0 comments on commit 78ab421

Please sign in to comment.