Skip to content

conversionFinished()

Arnd edited this page Sep 2, 2019 · 1 revision

conversionFinished(deviceNumber);

Boolean function which returns "true" when the given device's current status shows that the conversion has completed, otherwise it returns a "false". Calls to this routine return immediately without waiting.


Example:

INA_Class INA(); // Instantiate the class
void setup() {
  INA.begin(10,100000); // Max 10A and a 0.1 Ohm shunt resistor
  INA.setMode(INA_MODE_CONTINUOUS_BUS); // only compute bus values
  INA.setBusConversion(7);   // set bus conversion time 8.2446ms
  INA.setShuntConversion(7); // set shunt conversion time 8.2446ms
  INA.setAveraging(1024);    // set to 1024 samples
} // of setup
void loop() {
  bool conversionStatus = INA.conversionFinished(0); // check conversion for device #08.44 seconds on a INA226
  Serial.print("Device 0 conversion status is ");
  Serial.print(conversionStatus );
} // of main loop