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

Commit e4eac6e

Browse files
SV-ZanshinSV-Zanshin
authored andcommitted
Minor example display change
1 parent e1a3c4c commit e4eac6e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Examples/DisplayReadings/DisplayReadings.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void setup() { //
6767
// The begin initializes the calibration for an expected ±1 Amps maximum current and for a 0.1Ohm resistor, and //
6868
// since no specific device is given as the 3rd parameter all devices are initially set to these values //
6969
devicesFound = INA226.begin(1,100000); // Set expected Amps and resistor //
70-
Serial.print(F("Detected ")); // //
70+
Serial.print(F(" - Detected ")); // //
7171
Serial.print(devicesFound); // //
7272
Serial.println(F(" INA226 devices on I2C bus")); // //
7373
INA226.setAveraging(4); // Average each reading n-times //
@@ -80,6 +80,7 @@ void setup() { //
8080
** run in a simple infinite loop **
8181
*******************************************************************************************************************/
8282
void loop() { // Main program loop //
83+
static uint16_t loopCounter = 0; // Count the number of iterations //
8384
for (uint8_t i=0;i<devicesFound;i++) { // Loop through all devices found //
8485
Serial.print(F("Bus voltage ")); // //
8586
Serial.print(i+1); // //
@@ -97,8 +98,10 @@ void loop() { //
9798
Serial.print(i+1); // //
9899
Serial.print(F(": ")); // //
99100
Serial.print((float)INA226.getBusMicroWatts(i)/1000.0,4); // Convert to milliwatts //
100-
Serial.println(F("mW")); // //
101-
Serial.println(); // //
101+
Serial.print(F("mW\n\n")); // //
102102
} // of for-next each device loop // //
103-
delay(1000); // //
103+
delay(5000); // Wait 5 seconds for next reading //
104+
Serial.print(F("Loop iteration ") ); // //
105+
Serial.print(++loopCounter); // //
106+
Serial.print(F("\n\n") ); // //
104107
} // of method loop //----------------------------------//

0 commit comments

Comments
 (0)