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 DigitalOut detect(LED1); 00004 DigitalOut peaked(LED2); 00005 AnalogIn signal(p20); 00006 #define threshold 0.5 00007 #define peak 0.99 00008 00009 int main() { 00010 while (1) { 00011 printf("%f\n", signal.read()); 00012 if (signal.read() > threshold) detect=1; //turn on detect LED if the signal is greater than the threshold 00013 else {detect=0;} 00014 if (signal.read() > peak) peaked=1; // turn on peaked LED if the signal is too high 00015 else peaked = 0; 00016 wait(0.01); 00017 } 00018 }
Generated on Sun Jul 24 2022 05:44:10 by
1.7.2