-
Notifications
You must be signed in to change notification settings - Fork 40
getBusRaw()
This function returns the raw register value from the INA devices specified. Each INA2xx has a defined LSB for bus accuracy (typically 1.25 mV) and this would need to be applied to the raw value in order to convert it to a voltage reading. If the system mode is set to triggered measurements rather than continuous ones (see setMode() for details) then the next measurement cycle is triggered by this read.
This value is directly read from the INA2xx registers and is not affected by the settings for calibration given in the begin() function call.
INA_Class INA(); // Instantiate the class
void setup() {
uint8_t deviceCount = INA.begin(10,100000); // 10 Amp Maximum bus with a shunt resistor of 0.1 Ohm
Serial.print("Found ");
Serial.print(deviceCount);
Serial.print(" INA2xx devices, displaying data for device 0, a \"");
Serial.print(INA.getDeviceName());
Serial.println("\".");
} // of setup
void loop() {
uint16_t BusRaw = INA.getBusRaw(); // wait for conversion on device 0 to complete
Serial.print("INA Bus voltage register value is ");
Serial.print(BusRaw);
Serial.print("\n");
delay(5000); // wait 5 seconds before next measurement
} // of main loop
Overview
Installation
Class Instantiation
begin()
setI2CSpeed()
getBusMilliVolts()
getBusRaw()
getShuntMicroVolts()
getShuntRaw()
getBusMicroAmps()
getBusMicroWatts()
getDeviceAddress()
getDeviceName()
setMode()
setAveraging()
setBusConversion()
setShuntConversion()
reset()
waitForConversion()
conversionFinished()
alertOnConversion()
alertOnShuntOverVoltage()
alertOnShuntUnderVoltage()
alertOnBusOverVoltage()
alertOnBusUnderVoltage()
alertOnPowerOverLimit()