mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
detect Pi updates for LEDborg, mcp3008 and neopixel
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-pi-mcp3008",
|
||||
"version" : "0.0.2",
|
||||
"version" : "0.0.3",
|
||||
"description" : "A Node-RED node to read from the MCP3008 Analogue to Digital Converter",
|
||||
"dependencies" : {
|
||||
"mcp-spi-adc": "^0.0.1"
|
||||
|
@@ -18,8 +18,12 @@ module.exports = function(RED) {
|
||||
"use strict";
|
||||
var fs = require('fs');
|
||||
// unlikely if not on a Pi
|
||||
try { fs.statSync("/dev/ttyAMA0"); }
|
||||
catch(err) { throw "Info : Ignoring Raspberry Pi specific node"; }
|
||||
try {
|
||||
var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
|
||||
if (cpuinfo.indexOf(": BCM") === -1) { throw "Info : "+RED._("rpi-gpio.errors.ignorenode"); }
|
||||
} catch(err) {
|
||||
throw "Info : "+RED._("rpi-gpio.errors.ignorenode");
|
||||
}
|
||||
|
||||
var mcpadc = require('mcp-spi-adc');
|
||||
var mcp3008 = [];
|
||||
|
Reference in New Issue
Block a user