stephen smitherman / Mbed 2 deprecated UltraTest

Dependencies:   HCSR04 mbed

Files at this revision

API Documentation at this revision

Comitter:
srsmitherman
Date:
Tue Mar 11 21:20:40 2014 +0000
Commit message:
Test Program for HCSR04

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	Tue Mar 11 21:20:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/srsmitherman/code/HCSR04/#3ebde19131af
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Mar 11 21:20:40 2014 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "HCSR04.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX);
+HCSR04 ultra(p12,p11);
+
+float range=0;
+
+int main() {
+    
+        
+    pc.printf("Program Start\n");    
+    while(1) {
+        
+        ultra.startMeas();
+        
+        wait(0.2);
+        
+        
+        if( ultra.getMeas(range) == RANGE_MEAS_VALID)
+        {
+            pc.printf("Range - %f\n\r",  range);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Mar 11 21:20:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file