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 //Global objects 00004 BusOut binaryOutput(D5, D6, D7); //Outputs as an integer 00005 00006 DigitalIn SW1(D3); 00007 DigitalIn SW2(D4); 00008 00009 AnalogIn AIN(A0); 00010 float fVin = 0.0; 00011 00012 //Main function 00013 int main() { 00014 00015 00016 while(1) { 00017 00018 //Read ADC 00019 fVin = AIN; 00020 00021 //Write to terminal 00022 printf("Analog input = %6.4f\n", fVin); //3 decimal places, fieldwidth=5 00023 00024 //Wait 00025 wait(0.5); 00026 00027 } //end while(1) 00028 } //end main
Generated on Wed Jul 13 2022 01:16:22 by
1.7.2