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 int read_digital(void) { 00004 DigitalIn mydigital(p20); 00005 return(mydigital.read()); 00006 } 00007 00008 float read_analog(void) { 00009 AnalogIn myanalog(p20); 00010 return(myanalog.read()); 00011 } 00012 00013 int main() { 00014 while(1) { 00015 00016 printf("Digital reading : %d\n",read_digital()); 00017 wait(1.0); 00018 printf("Analog reading : %.2f\n",read_analog()); 00019 wait(1.0); 00020 00021 } 00022 }
Generated on Wed Jul 13 2022 08:53:09 by
