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: SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217
Fork of merged_code2_20sept_2017_4th_oct_2017 by
battery.cpp
- Committer:
- nikitateggi
- Date:
- 2017-06-24
- Revision:
- 24:d992ee8369f4
- Parent:
- 22:ffa88619551d
- Child:
- 37:92fcbf22bf91
File content as of revision 24:d992ee8369f4:
#include "mbed.h"
#include "battery.h"
AnalogIn A(PTB1);
float battery_voltage() {
// GLC_PWR=1;
// Enable=1;Shutdown=1;
float b_voltage;
//unsigned int samples1[4];
//unsigned int data2n;
b_voltage = A.read_u16()*(3.3/65535)*2;
wait(0.001f);
return b_voltage;
}
