mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
a475b67a19
commit
8d45e85acf
@ -62,7 +62,7 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="arduino out">
|
||||
<div class="form-row">
|
||||
<label for="node-input-arduino"><i class="fa fa-tasks"></i> <span data-i18n="arduino.label.arduino"></span></label>
|
||||
<label for="node-input-arduino"><i class="fa fa-tasks"></i> Arduino</label>
|
||||
<input type="text" id="node-input-arduino">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
@ -68,10 +68,10 @@ module.exports = function(RED) {
|
||||
this.arduino = n.arduino;
|
||||
this.serverConfig = RED.nodes.getNode(this.arduino);
|
||||
this.running = false;
|
||||
var node = this;
|
||||
if (typeof this.serverConfig === "object") {
|
||||
var startup = function() {
|
||||
this.board = this.serverConfig.board;
|
||||
var node = this;
|
||||
node.board = node.serverConfig.board;
|
||||
node.oldval = "";
|
||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.connecting"});
|
||||
var doit = function() {
|
||||
@ -119,12 +119,12 @@ module.exports = function(RED) {
|
||||
}
|
||||
if (node.board.isReady) { doit(); }
|
||||
else { node.board.once("ready", function() { doit(); }); }
|
||||
setTimeout(function() { if (!node.running) { startup(); } }, 4500);
|
||||
setTimeout(function() { if (node.running === false) { startup(); } }, 4500);
|
||||
}
|
||||
startup();
|
||||
}
|
||||
else {
|
||||
this.warn(RED._("arduino.errors.portnotconf"));
|
||||
node.warn(RED._("arduino.errors.portnotconf"));
|
||||
}
|
||||
node.on('close', function() {
|
||||
node.running = false;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-arduino",
|
||||
"version" : "0.2.1",
|
||||
"version" : "0.2.2",
|
||||
"description" : "A Node-RED node to talk to an Arduino running firmata",
|
||||
"dependencies" : {
|
||||
"firmata" : "^2.0.0"
|
||||
|
Loading…
Reference in New Issue
Block a user