node-red-contrib-i2c
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -172,10 +172,14 @@ module.exports = function(RED) { | ||
} else { | ||
// node.log('log write data'+ JSON.stringify([address, command, myPayload.length, myPayload, myPayload.toString("utf-8")])); | ||
node.port.writeI2cBlock(address, command, myPayload.length, myPayload, function(err) { | ||
if (err) { | ||
node.error(err, msg); | ||
} else { | ||
node.send(msg); | ||
} | ||
}); | ||
if (isNaN(command)) { | ||
node.port.i2cWrite(address, myPayload.length, myPayload, function(err) { | ||
if (err) { node.error(err, msg); } | ||
else { node.send(msg); } | ||
}); | ||
} | ||
else { | ||
node.port.writeI2cBlock(address, command, myPayload.length, myPayload, function(err) { | ||
if (err) { node.error(err, msg); } | ||
else { node.send(msg); } | ||
}); | ||
} | ||
} | ||
@@ -182,0 +186,0 @@ } catch(err) { |
{ | ||
"name": "node-red-contrib-i2c", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "A Node-RED node to talk to the Raspiberry PI's I2C port", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29219
184