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 Serial pc(USBTX, USBRX); 00004 00005 DigitalOut led1(LED1); // on board LED 00006 DigitalOut led2(p11); 00007 AnalogIn adc(p15); 00008 float ain; 00009 00010 int main() { 00011 while(1) { 00012 led1 = !led1; // blink LED 00013 ain = adc; 00014 if(ain < 0.4) led2 = 1; 00015 else led2 = 0; 00016 pc.printf("%f\r\n", (float)ain); 00017 wait(0.3); 00018 } 00019 }
Generated on Fri Jul 22 2022 23:07:57 by
1.7.2