Battery_hex
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaBattery_hex by
Diff: main.cpp
- Revision:
- 0:30e193b92735
- Child:
- 1:4e0d741b4ae2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 09 04:19:51 2016 +0000 @@ -0,0 +1,19 @@ +#include"mbed.h" +#include"HeptaBattery.h" +Serial pc(USBTX,USBRX); +HeptaBattery battery(p16,p29,p26); +int main(){ + pc.baud(9600); + int dsize; + float bt_dec; + char bt_hex[4]; + for(int i=0;i<10;i++){ + battery.vol(&bt_dec); + pc.printf("Vol=%f\r\n",bt_dec); + } + for(int j=0;j<10;j++){ + battery.vol_u16(bt_hex,&dsize); + pc.printf("Vol_hex=%c%c%c%c\r\n",bt_hex[0],bt_hex[1],bt_hex[2],bt_hex[3]); + } + wait(1.0); +} \ No newline at end of file