Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-i2c

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-i2c - npm Package Compare versions

Comparing version 0.8.4 to 0.9.0

27

i2c/26-i2c.js
module.exports = function(RED) {
"use strict";
var I2C = require("i2c-bus");
try {
var I2C = require("i2c-bus");
} catch (error) {
var I2C_ERROR = error;
I2C = null;
}
function validateI2C(node) {
if (!I2C) {
node.log("Couldn't load i2c-bus, is your platform supported ?");
node.status({fill:"gray",shape:"dot",text:"unsupported"});
if (I2C_ERROR) console.error(I2C_ERROR);
return false;
}
return true;
}
// The Scan Node

@@ -10,3 +25,5 @@ function I2CScanNode(n) {

var node = this;
if (!validateI2C(node)) return;
node.port = I2C.openSync(node.busno);

@@ -42,2 +59,4 @@ node.on("input", function(msg) {

var node = this;
if (!validateI2C(node)) return;

@@ -124,2 +143,4 @@ node.port = I2C.openSync(node.busno);

var node = this;
if (!validateI2C(node)) return;

@@ -193,2 +214,2 @@ node.port = I2C.openSync(node.busno);

RED.nodes.registerType("i2c out", I2COutNode);
}
}

2

package.json
{
"name": "node-red-contrib-i2c",
"version": "0.8.4",
"version": "0.9.0",
"description": "A Node-RED node to talk to the Raspiberry PI's I2C port",

@@ -5,0 +5,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc