Node.js INA219 driver for Adafruit INA219 High Side DC Current Sensor
npm install easybotics-ina219```bash ``
$ npm install easybotics-ina219
##Usage
`javascript
var ina219 = require('easybotics-ina219');
ina219.init();
ina219.enableLogging(true);
ina219.calibrate32V1A(function () {
ina219.getBusVoltage_V(function (volts) {
console.log("Voltage: " + volts);
ina219.getCurrent_mA(function (current){
console.log("Current (mA): " + current );
});
});
});
``
functionCallback for standard oncomplete
functionCallback for returning a single value
* Ina219
* new Ina219()
* .init(address, device)
* .enableLogging(enable)
* .writeRegister(register, value, callback)
* .readRegister(register, callback)
* .calibrate32V1A(callback)
* .log(s)
* .getBusVoltage_raw(callback)
* .getShuntVoltage_raw(callback)
* .getCurrent_raw(callback)
* .getBusVoltage_V(callback)
* .getShuntVoltage_mV(callback)
* .getCurrent_mA(callback)
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| address | string | Address you want to use. Defaults to INA219_ADDRESS |
| device | string | Device to connect to. Defaults to "/dev/i2c-1" |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| enable | bool | True to enable, False to disable |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| register | integer | Register to read from (One of INA219_REG_*) |
| value | integer | Value to be written |
| callback | writeRegisterCallback | Callback to be invoked when complete |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| register | integer | Register to read from (One of INA219_REG_*) |
| callback | onHaveValueCallback | Callback to be invoked when complete |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onCompleteCallback | Callback to be invoked when complete |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| s | string | String to log |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
Kind: instance method of Ina219
| Param | Type | Description |
| --- | --- | --- |
| callback | onHaveValueCallback | Callback to be invoked when complete. |
functionfunctionKind: global typedef
| Param | Type | Description |
| --- | --- | --- |
| value | int | value returned by async operation |