fix piliter byte mode

This commit is contained in:
Dave Conway-Jones 2017-09-14 12:13:28 +01:00
parent 605c2b0fe2
commit c62820a111
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D
2 changed files with 3 additions and 4 deletions

View File

@ -69,9 +69,8 @@ module.exports = function(RED) {
var l = Number(msg.payload.state);
if ((out >= 1) && (out <= 8)) {
out = (Math.pow(2, (out-1)));
if (l === 0) { out = ~ out; }
byte = byte & out & 255;
console.log("NOW",byte);
if (l === 0) { byte = (byte & (~out) & 255); }
else { byte = (byte | out) & 255; }
if (node.child !== null) { node.child.stdin.write(byte+"\n"); }
else { node.warn("Command not running"); }
}

View File

@ -1,6 +1,6 @@
{
"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.",
"dependencies" : {
},