Battery hex
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaBattery_hex by
main.cpp@2:7c5919465fc8, 2016-12-13 (annotated)
- Committer:
- MEXT1
- Date:
- Tue Dec 13 10:50:09 2016 +0000
- Revision:
- 2:7c5919465fc8
- Parent:
- 1:4e0d741b4ae2
Battery hex
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tomoya123 | 0:30e193b92735 | 1 | #include"mbed.h" |
tomoya123 | 0:30e193b92735 | 2 | #include"HeptaBattery.h" |
tomoya123 | 1:4e0d741b4ae2 | 3 | |
tomoya123 | 0:30e193b92735 | 4 | Serial pc(USBTX,USBRX); |
tomoya123 | 0:30e193b92735 | 5 | HeptaBattery battery(p16,p29,p26); |
tomoya123 | 1:4e0d741b4ae2 | 6 | |
tomoya123 | 0:30e193b92735 | 7 | int main(){ |
tomoya123 | 1:4e0d741b4ae2 | 8 | pc.baud(9600); |
tomoya123 | 1:4e0d741b4ae2 | 9 | float bt_dec; |
tomoya123 | 1:4e0d741b4ae2 | 10 | char bt_hex[4]; |
tomoya123 | 1:4e0d741b4ae2 | 11 | for(int i=0;i<10;i++){ |
tomoya123 | 1:4e0d741b4ae2 | 12 | battery.vol(&bt_dec); |
MEXT1 | 2:7c5919465fc8 | 13 | battery.vol_u16(bt_hex); |
tomoya123 | 1:4e0d741b4ae2 | 14 | pc.printf("Vol=%f\r\n",bt_dec); |
tomoya123 | 1:4e0d741b4ae2 | 15 | pc.printf("Vol_hex=%c%c%c%c\r\n",bt_hex[0],bt_hex[1],bt_hex[2],bt_hex[3]); |
tomoya123 | 1:4e0d741b4ae2 | 16 | wait(1.0); |
tomoya123 | 1:4e0d741b4ae2 | 17 | } |
tomoya123 | 0:30e193b92735 | 18 | } |