HEPTA-Sat Training 2019
/
Lab3-03_Detect_BatteryVoltage_HEX
Lab3
main.cpp
- Committer:
- HeptaSatTraining2019
- Date:
- 2019-08-21
- Revision:
- 26:e0f46da1ff13
- Parent:
- 25:4277e16b97c3
File content as of revision 26:e0f46da1ff13:
#include "mbed.h" #include "HEPTA_EPS.h" Serial pc(USBTX,USBRX); HEPTA_EPS eps(p16,p26); int main() { pc.baud(9600); float bt_dec; char bt_hex[4]; for(int i = 0; i < 10; i++) { eps.vol(&bt_dec); eps.vol_u16(bt_hex); pc.printf("Vol = %f\r\n",bt_dec); 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); } }