-
+
diff --git a/hardware/Arduino/35-arduino.js b/hardware/Arduino/35-arduino.js
index 062f11b2..8d604256 100644
--- a/hardware/Arduino/35-arduino.js
+++ b/hardware/Arduino/35-arduino.js
@@ -78,6 +78,15 @@ module.exports = function(RED) {
}
});
}
+ if (node.state === "PULLUP") {
+ node.board.pinMode(node.pin, 0x0B);
+ node.board.digitalRead(node.pin, function(v) {
+ if (v !== node.oldval) {
+ node.oldval = v;
+ node.send({payload:v, topic:node.pin});
+ }
+ });
+ }
if (node.state == "STRING") {
node.board.on('string', function(v) {
if (v !== node.oldval) {
diff --git a/hardware/Arduino/README.md b/hardware/Arduino/README.md
index 176d25a3..5a729834 100644
--- a/hardware/Arduino/README.md
+++ b/hardware/Arduino/README.md
@@ -23,7 +23,7 @@ details and examples of how to use this node.
Connects to local Arduino and monitors the selected pin for changes.
-You can select either **Digital**, **Analogue**, or **String** input type.
+You can select either **Digital**, **Pullup**, **Analogue**, or **String** input type.
Outputs the value read as `msg.payload` and the pin number as `msg.topic`.
It only outputs on a change of value - fine for digital inputs, but you can get a lot of data from analogue pins which you must then handle. For example you could use a `delay` node set to rate limit and drop intermediate values, or an `rbe` node to only report when it changes by a certain amount.
diff --git a/hardware/Arduino/locales/en-US/35-arduino.json b/hardware/Arduino/locales/en-US/35-arduino.json
index 7e731a50..640bfdc1 100644
--- a/hardware/Arduino/locales/en-US/35-arduino.json
+++ b/hardware/Arduino/locales/en-US/35-arduino.json
@@ -18,6 +18,7 @@
"state": {
"in": {
"digital": "Digital pin",
+ "pullup": "Digital pin with pullup",
"analogue": "Analogue pin",
"string": "String"
},
diff --git a/hardware/Arduino/package.json b/hardware/Arduino/package.json
index acc770eb..6b3b061a 100644
--- a/hardware/Arduino/package.json
+++ b/hardware/Arduino/package.json
@@ -1,6 +1,6 @@
{
"name" : "node-red-node-arduino",
- "version" : "0.0.17",
+ "version" : "0.0.18",
"description" : "A Node-RED node to talk to an Arduino running firmata",
"dependencies" : {
"firmata" : "~0.19.1"