Battery hex

Dependencies:   mbed PowerControl SDFileSystem

Fork of HeptaBattery_hex by 智也 大野

Committer:
tomoya123
Date:
Fri Dec 09 04:19:51 2016 +0000
Revision:
0:30e193b92735
Child:
1:4e0d741b4ae2
Battery_hex

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tomoya123 0:30e193b92735 1 #include"mbed.h"
tomoya123 0:30e193b92735 2 #include"HeptaBattery.h"
tomoya123 0:30e193b92735 3 Serial pc(USBTX,USBRX);
tomoya123 0:30e193b92735 4 HeptaBattery battery(p16,p29,p26);
tomoya123 0:30e193b92735 5 int main(){
tomoya123 0:30e193b92735 6 pc.baud(9600);
tomoya123 0:30e193b92735 7 int dsize;
tomoya123 0:30e193b92735 8 float bt_dec;
tomoya123 0:30e193b92735 9 char bt_hex[4];
tomoya123 0:30e193b92735 10 for(int i=0;i<10;i++){
tomoya123 0:30e193b92735 11 battery.vol(&bt_dec);
tomoya123 0:30e193b92735 12 pc.printf("Vol=%f\r\n",bt_dec);
tomoya123 0:30e193b92735 13 }
tomoya123 0:30e193b92735 14 for(int j=0;j<10;j++){
tomoya123 0:30e193b92735 15 battery.vol_u16(bt_hex,&dsize);
tomoya123 0:30e193b92735 16 pc.printf("Vol_hex=%c%c%c%c\r\n",bt_hex[0],bt_hex[1],bt_hex[2],bt_hex[3]);
tomoya123 0:30e193b92735 17 }
tomoya123 0:30e193b92735 18 wait(1.0);
tomoya123 0:30e193b92735 19 }