jason berry
/
pingtest2
ping test2
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 // Continuously send pings and read the sensor 00002 #include "mbed.h" 00003 #include "Ping.h" 00004 00005 Ping Pinger(p21); 00006 Serial pc(USBTX, USBRX); // tx, rx 00007 00008 int main() 00009 { 00010 int range; 00011 00012 pc.printf("Hello World ping test!\n"); 00013 while(1) 00014 { 00015 Pinger.Send(); 00016 wait_ms(30); 00017 range = Pinger.Read_cm(); 00018 pc.printf("$%d;",range); 00019 } 00020 }
Generated on Fri Aug 5 2022 03:58:29 by 1.7.2