Parking sensor project ELEC2645

Dependencies:   N5110 SRF02 TMP102 mbed

Files at this revision

API Documentation at this revision

Comitter:
el14adr
Date:
Thu May 05 15:17:37 2016 +0000
Parent:
0:7f408d2bc038
Commit message:
Parking Sensor Project

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu May 05 14:58:40 2016 +0000
+++ b/main.cpp	Thu May 05 15:17:37 2016 +0000
@@ -77,6 +77,8 @@
     /// Convert calcuated distance to inches
     g_calcDistanceInches = g_calcDistance * 0.3937007874;
 
+    lcd.printString("Distance =",0,0); // Display distance = 
+
     /// Read temperature, save to buffer and print to lcd
     float tempMemory = sprintf(bufferTemp, "T = %.2f C",temp); // saves temperature to buffer
     lcd.printString(bufferTemp,0,4); // displays temperature buffer on lcd
@@ -134,8 +136,8 @@
         buzzer.write(0.8);
     }
     else if (g_calcDistance > 30 && g_calcDistance <= 70) { // in between pitch
-        buzzer.write(0.5);
+        buzzer.write(0.3);
         }
     else if (g_calcDistance > 70) // low pitch safer distance
-        buzzer.write(0.1);
+        buzzer.write(0);
 }