Closed danny12321 closed 5 years ago
I am trying to get an ina219 to work on the address 0x41. It is showing op with the command below.
sudo i2cdetect -y 1
But when I try my code below I get this error.
var ina219 = require('ina219'); ina219.init("0x41"); 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 ); }); }); });
Can you please help me. Thanks in advance!
I see my own problem now. In the docs it says the address (in my case 0x41) has to be a string but it needs to be a hexadecimal instead.
I am trying to get an ina219 to work on the address 0x41. It is showing op with the command below.
But when I try my code below I get this error.
Can you please help me. Thanks in advance!