3434** **
3535** Vers. Date Developer Comments **
3636** ====== ========== ============================= ============================================================== **
37+ ** 1.0.5 2018-06-08 https://github.com/SV-Zanshin removed unneeded prototype definitions **
3738** 1.0.4 2018-06-01 https://github.com/SV-Zanshin https://github.com/SV-Zanshin/INA226/issues/11 Corrected loop **
3839** 1.0.3 2017-09-18 https://github.com/SV-Zanshin https://github.com/SV-Zanshin/INA226/issues/6 Multiple INA226s **
3940** 1.0.2 2017-08-09 https://github.com/SV-Zanshin Cosmetic changes **
@@ -52,11 +53,6 @@ const uint32_t SERIAL_SPEED = 115200; //
5253INA226_Class INA226; // INA class instantiation //
5354uint8_t devicesFound = 0 ; // Number of INA226s found //
5455/* ******************************************************************************************************************
55- ** Declare prototypes for all functions used **
56- *******************************************************************************************************************/
57- void setup (); // Called once on power-up/restart //
58- void loop (); // Called repeatedly after setup() //
59- /* ******************************************************************************************************************
6056** Method Setup(). This is an Arduino IDE method which is called first upon initial boot or restart. It is only **
6157** called one time and all of the variables and other initialization calls are done here prior to entering the **
6258** main loop for data measurement and storage. **
@@ -66,10 +62,12 @@ void setup() { //
6662 #ifdef __AVR_ATmega32U4__ // If we are a 32U4 processor, then //
6763 delay (2000 ); // wait 2 seconds for the serial //
6864 #endif // interface to initialize //
69- Serial.print (F (" \n\n Display INA226 Readings V1.0.3\n " )); // Display program information //
65+ Serial.print (F (" \n\n Display INA226 Readings V1.0.5\n " )); // Display program information //
66+ Serial.print (F (" - Searching & Initializing INA226\n " )); // Display program information //
7067 // The begin initializes the calibration for an expected ±1 Amps maximum current and for a 0.1Ohm resistor, and //
7168 // since no specific device is given as the 3rd parameter all devices are initially set to these values //
72- devicesFound = INA226.begin (1 ,100000 ); // Set expected Amps and resistor //
69+ devicesFound = INA226.begin (1 ,1960000 ); // Set expected Amps and resistor //
70+ // devicesFound = INA226.begin(1,100000); // Set expected Amps and resistor //
7371 Serial.print (F (" Detected " )); // //
7472 Serial.print (devicesFound); // //
7573 Serial.println (F (" INA226 devices on I2C bus" )); // //
@@ -95,13 +93,13 @@ void loop() { //
9593 Serial.print (F (" mV\n Bus amperage " )); // //
9694 Serial.print (i+1 ); // //
9795 Serial.print (F (" : " )); // //
98- Serial.print ((float )INA226.getBusMicroAmps (i)/1000.0 ,3 ); // Convert to milliamp //
96+ Serial.print ((float )INA226.getBusMicroAmps (i)/1000.0 ,4 ); // Convert to milliamp //
9997 Serial.print (F (" mA\n Bus wattage " )); // //
10098 Serial.print (i+1 ); // //
10199 Serial.print (F (" : " )); // //
102- Serial.print ((float )INA226.getBusMicroWatts (i)/1000.0 ,3 ); // Convert to milliwatts //
100+ Serial.print ((float )INA226.getBusMicroWatts (i)/1000.0 ,4 ); // Convert to milliwatts //
103101 Serial.println (F (" mW" )); // //
104102 Serial.println (); // //
105103 } // of for-next each device loop // //
106- delay (5000 ); // //
104+ delay (1000 ); // //
107105} // of method loop //----------------------------------//
0 commit comments