4180Lab3Part1

Dependencies:   HC_SR04_Ultrasonic_Library mbed

Fork of LPC1768_HCSR04_HelloWorld by jim hamblen

Revision:
3:9285821440d2
Parent:
2:3566c2d1e86b
--- a/main.cpp	Tue Sep 13 18:16:42 2016 +0000
+++ b/main.cpp	Mon Feb 27 22:55:09 2017 +0000
@@ -4,7 +4,9 @@
  void dist(int distance)
 {
     //put code here to execute when the distance has changed
-    printf("Distance %d mm\r\n", distance);
+    if(distance*0.00328084 < 40) {
+    printf("Distance %f ft\r\n", distance*0.00328084);
+    }
 }
 
 ultrasonic mu(p6, p7, .1, 1, &dist);    //Set the trigger pin to D8 and the echo pin to D9