mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
fix piliter byte mode
This commit is contained in:
@@ -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"); }
|
||||
}
|
||||
|
Reference in New Issue
Block a user