Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.

Commit bb4bffe

Browse files
committed
Fixed Bug #11
Example program didn't address the device in the loop but always used the default device.
1 parent 881afa7 commit bb4bffe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Examples/DisplayReadings/DisplayReadings.ino

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
** **
3535
** Vers. Date Developer Comments **
3636
** ====== ========== ============================= ============================================================== **
37+
** 1.0.4 2018-06-01 https://github.com/SV-Zanshin https://github.com/SV-Zanshin/INA226/issues/11 Corrected loop **
3738
** 1.0.3 2017-09-18 https://github.com/SV-Zanshin https://github.com/SV-Zanshin/INA226/issues/6 Multiple INA226s **
3839
** 1.0.2 2017-08-09 https://github.com/SV-Zanshin Cosmetic changes **
3940
** 1.0.1 2017-01-12 https://github.com/SV-Zanshin Minor code cleanup and added more comments **
@@ -86,19 +87,19 @@ void loop() { //
8687
Serial.print(F("Bus voltage ")); // //
8788
Serial.print(i+1); // //
8889
Serial.print(F(": ")); // //
89-
Serial.print((float)INA226.getBusMilliVolts()/1000.0,4); // Convert to millivolts //
90+
Serial.print((float)INA226.getBusMilliVolts(true,i)/1000.0,4); // Convert to millivolts //
9091
Serial.print(F("V\nShunt voltage ")); // //
9192
Serial.print(i+1); // //
9293
Serial.print(F(": ")); // //
93-
Serial.print((float)INA226.getShuntMicroVolts()/1000.0,3); // Convert to millivolts //
94+
Serial.print((float)INA226.getShuntMicroVolts(true,i)/1000.0,3); // Convert to millivolts //
9495
Serial.print(F("mV\nBus amperage ")); // //
9596
Serial.print(i+1); // //
9697
Serial.print(F(": ")); // //
97-
Serial.print((float)INA226.getBusMicroAmps()/1000.0,3); // Convert to milliamp //
98+
Serial.print((float)INA226.getBusMicroAmps(i)/1000.0,3); // Convert to milliamp //
9899
Serial.print(F("mA\nBus wattage ")); // //
99100
Serial.print(i+1); // //
100101
Serial.print(F(": ")); // //
101-
Serial.print((float)INA226.getBusMicroWatts()/1000.0,3); // Convert to milliwatts //
102+
Serial.print((float)INA226.getBusMicroWatts(i)/1000.0,3); // Convert to milliwatts //
102103
Serial.println(F("mW")); // //
103104
Serial.println(); // //
104105
} // of for-next each device loop // //

0 commit comments

Comments
 (0)