for textbook v4.4

Dependencies:   mbed HCSR04

HC-SR04 program

Files at this revision

API Documentation at this revision

Comitter:
HeptaSatTraining2019
Date:
Wed Nov 06 18:12:17 2019 +0000
Commit message:

Changed in this revision

HCSR04.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 5f87b3c8e32a HCSR04.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HCSR04.lib	Wed Nov 06 18:12:17 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/prabhuvd/code/HCSR04/#71da0dbf4400
diff -r 000000000000 -r 5f87b3c8e32a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 06 18:12:17 2019 +0000
@@ -0,0 +1,14 @@
+#include "mbed.h"
+#include "hcsr04.h"
+Serial pc(USBTX, USBRX); 
+HCSR04  usensor(p21,p12);
+int dist;
+int main()
+{
+    while(1) {
+        usensor.start();
+        dist=usensor.get_dist_cm();
+        pc.printf("distance = %d [cm]\r\n",dist);
+        wait(1);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 5f87b3c8e32a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 06 18:12:17 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file