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_SENSOR mbed HEPTA_EPS HEPTA_COM HEPTA_CDH
main.cpp
- Committer:
- MEXT1
- Date:
- 2020-07-22
- Revision:
- 27:6f3dec57c1d5
- Parent:
- 26:220e5f95168a
File content as of revision 27:6f3dec57c1d5:
#include "mbed.h" #include "HEPTA_EPS.h" Serial pc(USBTX,USBRX); HEPTA_EPS eps(p16,p26); int main() { pc.baud(9600); int flag = 0; // condition float btvol; for(int i = 0; i < 100; i++) { //Get Battery Voltage eps.vol(&btvol); pc.printf("BatVol = %.2f [V]\r\n",btvol); //Power Saving Mode if(btvol <= 3.5) { eps.shut_down_regulator(); flag = 1; } else { eps.turn_on_regulator(); flag = 0; } if(flag == 1) { pc.printf("Power saving mode ON\r\n"); } wait(1.0); } }