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 #include "SRF05.h" 00003 00004 DigitalOut myled(LED1); 00005 SRF05 front (p24,p23); 00006 Serial pc(USBTX, USBRX); 00007 00008 float dist; 00009 00010 int main() { 00011 while (1) { 00012 dist = front.read(); 00013 if (dist < 10) { 00014 myled =1; 00015 } 00016 else { 00017 myled=0; 00018 } 00019 pc.printf("%.2f\n", dist); 00020 00021 wait(0.5); 00022 } 00023 }
Generated on Wed Jul 13 2022 21:46:08 by
1.7.2