albatross
/
INA226TEST
1月13日分
Fork of INA226TEST by
Diff: main.cpp
- Revision:
- 2:ae52901630fc
- Parent:
- 0:b20f8673a7fa
--- 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(); }