Skip to content

reset()

Arnd edited this page Dec 12, 2020 · 3 revisions

reset([deviceNumber]);

This function writes a reset flag to the configuration register of the INA2xx specified in the optional "deviceNumber" parameter, defaulting to resetting ALL devices. This is a software reset, which is equivalent to turning the device off and on again. The reset is fast, at 40 microseconds.

The devices will have the following default settings upon restart:

  • Don't average readings
  • Use a conversion speed of 1.1ms per Bus conversion
  • Use a conversion speed of 1.1ms per Shunt conversion
  • Continuously convert both Bus and Shunt measurements
  • Calibration Register recomputed according to values set with the corresponding begin() prior to the reset.

Example:

INA_Class INA(); // Instantiate the class
void setup() {
  INA.begin(10,100000); // 10A Maximum with a 0.1 Ohm shunt resistor 
  int32_t busMicroAmps= INA.getBusMicroAmps();
  Serial.print("Bus amperage is ");
  Serial.print((float)busMicroAmps/1000,3);
  Serial.print(" mA\n");
  INA.reset()
  int32_t busMicroAmps = INA.getBusMicroAmps(); // value will now be 0
  Serial.print("Bus amperage is ");
  Serial.print((float)busMicroAmps/1000,3);
  Serial.print(" mA\n");
} // of setup
void loop() {
} // of main loop