Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
 - 1:f2050723c26f
 - Parent:
 - 0:503735f92bfb
 
--- a/main.cpp	Sun Feb 09 06:56:37 2014 +0000
+++ b/main.cpp	Sun Feb 09 11:28:40 2014 +0000
@@ -47,10 +47,10 @@
 #define AUPOWER_REG_VSPARE      0x06
 #define AUPOWER_REG_TEMP        0x08
 
-#define AUPOWER_LOW_SENS_MODE   0x01  // Low sensitivity mode (amlifier gain = 4x)
+#define AUPOWER_LOW_SENS_MODE   0x01  // Low sensitivity mode (amplifier gain = 4x)
 #define AUPOWER_HIGH_SENS_MODE  0x02  // High sensitivity mode (amplifier gain = 8x)
 #define AUPOWER_RUN             0x07  // Start all sensors in fast-read mode, 
-                                      //  sequentially updating every 2ms.
+                                      //  sequentially updating every 10ms.
 
 /* 
    There are two current sensing modes - low and high sensitivity.
@@ -141,7 +141,7 @@
     return -1;
 }
 
-// start the monitor unit (continiusly reading all sensors)
+// start the monitor unit (continuously reading all sensors)
 int aupower_init(void)
 {
     // we can use the initial value of the temperature as a whoami - must be 0x80 on power-on reset before
@@ -158,11 +158,11 @@
     // initialise the measurement unit
     
 #ifdef AUPOWER_HIGH_SENS
-    // high sensitivity, 80A max
+    // high sensitivity, 110A max
     if (i2c_reg8_write(AUPOWER_I2C_ADDRESS,AUPOWER_REG_CTL1,AUPOWER_HIGH_SENS_MODE) != 0)
         return -1;
 #else 
-    // OR low sensitivity, 120A max
+    // OR low sensitivity, 220A max
     if (i2c_reg8_write(AUPOWER_I2C_ADDRESS,AUPOWER_REG_CTL1,AUPOWER_LOW_SENS_MODE) != 0)
         return -1;
 #endif
@@ -171,7 +171,7 @@
     return i2c_reg8_write(AUPOWER_I2C_ADDRESS,AUPOWER_REG_CTL1,AUPOWER_RUN);
 }
 
-// read the sensors and convert ADC units to si
+// read the current/voltage sensors and convert ADC units to si
 int aupower_read_sensors(uint8_t sensor, float* fValue)
 {
     int16_t tmp1, tmp2;