ping test

Dependencies:   mbed Ping

Files at this revision

API Documentation at this revision

Comitter:
jasonberry
Date:
Tue Feb 02 13:46:38 2021 +0000
Commit message:
ping hello world

Changed in this revision

Ping.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 3898412e9440 Ping.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Ping.lib	Tue Feb 02 13:46:38 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/rosienej/code/Ping/#6996f66161d7
diff -r 000000000000 -r 3898412e9440 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 02 13:46:38 2021 +0000
@@ -0,0 +1,20 @@
+// Continuously send pings and read the sensor
+#include "mbed.h"
+#include "Ping.h"
+ 
+Ping Pinger(p21);
+Serial pc(USBTX, USBRX); // tx, rx
+  
+int main() 
+{
+ int range;
+ 
+ pc.printf("Hello World ping test!\n");
+ while(1) 
+    {
+    Pinger.Send();    
+    wait_ms(30);
+    range = Pinger.Read_cm();
+    pc.printf("$%d;",range);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 3898412e9440 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Feb 02 13:46:38 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/aa5281ff4a02
\ No newline at end of file