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">
|
<script type="text/x-red" data-template-name="arduino out">
|
||||||
<div class="form-row">
|
<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">
|
<input type="text" id="node-input-arduino">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
|
@ -68,10 +68,10 @@ module.exports = function(RED) {
|
|||||||
this.arduino = n.arduino;
|
this.arduino = n.arduino;
|
||||||
this.serverConfig = RED.nodes.getNode(this.arduino);
|
this.serverConfig = RED.nodes.getNode(this.arduino);
|
||||||
this.running = false;
|
this.running = false;
|
||||||
|
var node = this;
|
||||||
if (typeof this.serverConfig === "object") {
|
if (typeof this.serverConfig === "object") {
|
||||||
var startup = function() {
|
var startup = function() {
|
||||||
this.board = this.serverConfig.board;
|
node.board = node.serverConfig.board;
|
||||||
var node = this;
|
|
||||||
node.oldval = "";
|
node.oldval = "";
|
||||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.connecting"});
|
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.connecting"});
|
||||||
var doit = function() {
|
var doit = function() {
|
||||||
@ -119,12 +119,12 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
if (node.board.isReady) { doit(); }
|
if (node.board.isReady) { doit(); }
|
||||||
else { node.board.once("ready", function() { doit(); }); }
|
else { node.board.once("ready", function() { doit(); }); }
|
||||||
setTimeout(function() { if (!node.running) { startup(); } }, 4500);
|
setTimeout(function() { if (node.running === false) { startup(); } }, 4500);
|
||||||
}
|
}
|
||||||
startup();
|
startup();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.warn(RED._("arduino.errors.portnotconf"));
|
node.warn(RED._("arduino.errors.portnotconf"));
|
||||||
}
|
}
|
||||||
node.on('close', function() {
|
node.on('close', function() {
|
||||||
node.running = false;
|
node.running = false;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-arduino",
|
"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",
|
"description" : "A Node-RED node to talk to an Arduino running firmata",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"firmata" : "^2.0.0"
|
"firmata" : "^2.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user