nodejs-adcpi
v0.1.1
Published
NodeJS library for reading the values generated by the MCP3424 Analog / Digital Converter of AB Electronics
Downloads
2
Readme
nodejs-adcpi for mcp3424
NodeJS library for reading the values generated by the Analog / Digital Converter of AB Electronics:
https://www.abelectronics.co.uk/products/17/Raspberry-Pi--Raspberry-Pi-2-Model-B/56/ADC-Pi-Plus---Raspberry-Pi-Analogue-to-Digital-converter
Example usage:
var mcp3424 = require('./mcp3424');
var address = 0x68;
var gain = 0; //{0,1,2,3} represents {x1,x2,x4,x8}
var resolution = 3; //{0,1,2,3} and represents {12,14,16,18} bits
var mcp = new mcp3424(address, gain, resolution, '/dev/i2c-1');
setInterval(function(){
console.log('Reading: ' + mcp.getVoltage(0));
}, 1000);