Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HEPTA_CDH HEPTA_COM HEPTA_EPS HEPTA_SENSOR mbed
main.cpp
00001 #include "mbed.h" 00002 #include "HEPTA_EPS.h" 00003 RawSerial pc(USBTX,USBRX,9600); 00004 HEPTA_EPS eps(p16,p26); 00005 int main() { 00006 int flag = 0; // condition 00007 float btvol; 00008 for(int i = 0; i < 100; i++) { 00009 //Get Battery Voltage 00010 eps.vol(&btvol); 00011 pc.printf("BatVol = %.2f [V]\r\n",btvol); 00012 //Power Saving Mode 00013 if(btvol <= 3.5) { 00014 eps.shut_down_regulator(); 00015 flag = 1; 00016 } else { 00017 eps.turn_on_regulator(); 00018 flag = 0; 00019 } 00020 if(flag == 1) { 00021 pc.printf("Power saving mode ON\r\n"); 00022 } 00023 wait(1.0); 00024 } 00025 }
Generated on Mon Nov 7 2022 14:56:55 by
1.7.2