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.
main.cpp
00001 #include "mbed.h" 00002 00003 AnalogIn Battery(p15); 00004 Serial pc(USBTX, USBRX); 00005 00006 int main() { 00007 while(1) { 00008 00009 float a, Vcc, R1=46.6, R2=11.92 ; 00010 00011 a=Battery.read(); 00012 00013 Vcc = (a*3.3*(R1+R2)/R2) - 0.32; 00014 00015 pc.printf(" a = %f \n", a); 00016 pc.printf(" Voltage = %f \n", Vcc); 00017 wait(1); 00018 00019 00020 00021 } 00022 }
Generated on Wed Jul 13 2022 13:41:08 by
1.7.2