This is a Node.JS module for the ADS1015 analog to digital converter. Provides two simple asynchronous methods to interact with the device:
init(i2c_bus_number, device_address)
- initialises the device, both parameters are optionalmeasure(channel, gain)
- performs a single conversion on the given channel with the specified gain
The two constants contain the default values for the I2C bus number and device address.
I2C_BUS
- defaults to bus number 1I2C_ADDRESS
- defaults to address 0x48
Two enumerations facilitate calls to the measure(...)
method (see source code for details):
Gain
- controls the programmable gain amplifier of the deviceChannel
- selects the device input
The script test.js provides some sample code which may be used to test connectivity to the device.
This module isn't published to the NPM registry and needs to be installed from GitHub with the command:
npm install https://github.com/sailingscally/ads1015