Skip to content

Commit 8d45e85

Browse files
author
Dave Conway-Jones
committed
arduino node - slight tidy, fix node declaration
to close #535
1 parent a475b67 commit 8d45e85

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

hardware/Arduino/35-arduino.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
<script type="text/x-red" data-template-name="arduino out">
6464
<div class="form-row">
65-
<label for="node-input-arduino"><i class="fa fa-tasks"></i> <span data-i18n="arduino.label.arduino"></span></label>
65+
<label for="node-input-arduino"><i class="fa fa-tasks"></i> Arduino</label>
6666
<input type="text" id="node-input-arduino">
6767
</div>
6868
<div class="form-row">

hardware/Arduino/35-arduino.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ module.exports = function(RED) {
6868
this.arduino = n.arduino;
6969
this.serverConfig = RED.nodes.getNode(this.arduino);
7070
this.running = false;
71+
var node = this;
7172
if (typeof this.serverConfig === "object") {
7273
var startup = function() {
73-
this.board = this.serverConfig.board;
74-
var node = this;
74+
node.board = node.serverConfig.board;
7575
node.oldval = "";
7676
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.connecting"});
7777
var doit = function() {
@@ -119,12 +119,12 @@ module.exports = function(RED) {
119119
}
120120
if (node.board.isReady) { doit(); }
121121
else { node.board.once("ready", function() { doit(); }); }
122-
setTimeout(function() { if (!node.running) { startup(); } }, 4500);
122+
setTimeout(function() { if (node.running === false) { startup(); } }, 4500);
123123
}
124124
startup();
125125
}
126126
else {
127-
this.warn(RED._("arduino.errors.portnotconf"));
127+
node.warn(RED._("arduino.errors.portnotconf"));
128128
}
129129
node.on('close', function() {
130130
node.running = false;

hardware/Arduino/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name" : "node-red-node-arduino",
3-
"version" : "0.2.1",
3+
"version" : "0.2.2",
44
"description" : "A Node-RED node to talk to an Arduino running firmata",
55
"dependencies" : {
66
"firmata" : "^2.0.0"

0 commit comments

Comments
 (0)