Battery hex

Dependencies:   mbed PowerControl SDFileSystem

Fork of HeptaBattery_hex by 智也 大野

main.cpp

Committer:
tomoya123
Date:
2016-12-09
Revision:
0:30e193b92735
Child:
1:4e0d741b4ae2

File content as of revision 0:30e193b92735:

#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);
}