mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix piliter byte mode
This commit is contained in:
parent
605c2b0fe2
commit
c62820a111
@ -69,9 +69,8 @@ module.exports = function(RED) {
|
|||||||
var l = Number(msg.payload.state);
|
var l = Number(msg.payload.state);
|
||||||
if ((out >= 1) && (out <= 8)) {
|
if ((out >= 1) && (out <= 8)) {
|
||||||
out = (Math.pow(2, (out-1)));
|
out = (Math.pow(2, (out-1)));
|
||||||
if (l === 0) { out = ~ out; }
|
if (l === 0) { byte = (byte & (~out) & 255); }
|
||||||
byte = byte & out & 255;
|
else { byte = (byte | out) & 255; }
|
||||||
console.log("NOW",byte);
|
|
||||||
if (node.child !== null) { node.child.stdin.write(byte+"\n"); }
|
if (node.child !== null) { node.child.stdin.write(byte+"\n"); }
|
||||||
else { node.warn("Command not running"); }
|
else { node.warn("Command not running"); }
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-piliter",
|
"name" : "node-red-node-piliter",
|
||||||
"version" : "0.0.10",
|
"version" : "0.0.11",
|
||||||
"description" : "A Node-RED node to drive a Raspberry Pi Pi-LITEr 8 LED board.",
|
"description" : "A Node-RED node to drive a Raspberry Pi Pi-LITEr 8 LED board.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user