1月13日分

Dependencies:   INA226 mbed

Fork of INA226TEST by Toshihisa T

Files at this revision

API Documentation at this revision

Comitter:
YusukeWakuta
Date:
Wed Jan 13 11:07:27 2016 +0000
Parent:
1:a942950ac282
Commit message:
1?13??

Changed in this revision

INA226.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a942950ac282 -r ae52901630fc INA226.lib
--- a/INA226.lib	Sat Nov 24 18:38:51 2012 +0000
+++ b/INA226.lib	Wed Jan 13 11:07:27 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/tosihisa/code/INA226/#8950b0f31d73
+https://developer.mbed.org/users/YusukeWakuta/code/INA226/#c5a37989a625
diff -r a942950ac282 -r ae52901630fc main.cpp
--- a/main.cpp	Sat Nov 24 18:38:51 2012 +0000
+++ b/main.cpp	Wed Jan 13 11:07:27 2016 +0000
@@ -12,16 +12,17 @@
 INA226 VCmonitor(i2c);
 
 int main() {
+    i2c.start();
     unsigned short val;
     double V,C;
     int count = 1;
 
     debug.format(8,ParityNone,1);
-    debug.baud(115200);
-    debug.printf("VCmonitor INA226 TEST Program. (BUILD:[" __DATE__ "/" __TIME__ "])\n");
+    debug.baud(9600);
+    debug.printf("VCmonitor INA226 TEST Program. (BUILD:[" __DATE__ "/" __TIME__ "])\n\r");
 
     if(!VCmonitor.isExist()){
-        debug.printf("VCmonitor NOT FOUND\n");
+        debug.printf("VCmonitor NOT FOUND\n\r");
         while(1){}
     }
     debug.printf("VCmonitor FOUND\n");
@@ -37,7 +38,7 @@
 
     while(1) {
         if((VCmonitor.getVoltage(&V) == 0) && (VCmonitor.getCurrent(&C) == 0)){
-            debug.printf("%d,V,%f,C,%f\n",count,V,C);
+            debug.printf("%d,V,%f,C,%f\n\r",count,V,C);
         }
         myled = 1;
         wait(0.5);
@@ -45,4 +46,5 @@
         wait(0.5);
         count++;
     }
+    i2c.stop();
 }