hcsr04

Dependencies:   HCSR04 mbed

Files at this revision

API Documentation at this revision

Comitter:
oakx
Date:
Wed Jul 02 17:40:12 2014 +0000
Commit message:
oak;

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 Jul 02 17:40:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/prabhuvd/code/HCSR04/#71da0dbf4400
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 02 17:40:12 2014 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "hcsr04.h"
+ 
+HCSR04  usensor(p26,p16);//trig pin,echo pin
+Serial pc(USBTX, USBRX);
+unsigned int dist;
+int main()
+{
+ 
+    while(1) {
+        usensor.start();
+        wait_ms(500); 
+        dist=usensor.get_dist_cm();
+        pc.printf("Distance = %d cm\n",dist);
+ 
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 02 17:40:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file