4180Lab3Part1
Dependencies: HC_SR04_Ultrasonic_Library mbed
Fork of LPC1768_HCSR04_HelloWorld by
Revision 3:9285821440d2, committed 2017-02-27
- Comitter:
- CRaslawski
- Date:
- Mon Feb 27 22:55:09 2017 +0000
- Parent:
- 2:3566c2d1e86b
- Commit message:
- initial commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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
