Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 621 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 621 Bytes

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);