jason berry
/
pingtestdean
ping test
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 Mon Aug 1 2022 00:14:09 by 1.7.2