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
--- /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
--- /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
--- /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