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.
waveRx.cpp
00001 #include "mbed.h" 00002 00003 AnalogIn AD(PTB1); 00004 Serial pc(USBTX, USBRX); // tx, rx 00005 00006 //Global variable, delay time 00007 float dt=0; 00008 00009 void callback() { 00010 00011 pc.printf("Input parameter dt and press Enter:\n"); 00012 pc.scanf("%f", &dt); 00013 pc.printf("%f\n", dt); 00014 pc.printf("Continue...\n"); 00015 00016 } 00017 00018 00019 00020 int main(void) { 00021 00022 00023 //pc.attach(&callback); 00024 00025 while(1){ 00026 00027 pc.attach(&callback); 00028 00029 //Monitor Received Analog In 00030 pc.printf("%f ", AD.read()); 00031 wait(dt); 00032 //wait(3.0); 00033 } 00034 }
Generated on Sat Aug 27 2022 21:38:58 by
1.7.2