Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Revision:
72:f8c4f731f0fe
Parent:
68:b769c0f23406
diff -r 38bb6bf09933 -r f8c4f731f0fe ProximityController.cpp
--- a/ProximityController.cpp	Tue Jun 21 12:09:12 2016 +0000
+++ b/ProximityController.cpp	Tue Jun 21 13:48:28 2016 +0000
@@ -12,6 +12,8 @@
     range = pinger.Read_cm()/ 2;   
     this->distance = (float)range;
     
+    printf("Read distance: %.3f\r\n", distance);
+    
     if(distance < 0.01) {
         SensorAlarmController::buzzOnce();
         setLed(true);
@@ -28,7 +30,7 @@
     if(distance < 0.01) {
         this->volume = -1.0f;    
     } else {
-        this->volume = (DISTANCE_TO_BASE - this->distance) * ((100.0f/12.0f) * 10);
+        this->volume = (DISTANCE_TO_BASE - this->distance) * 76.92f;
     }
     
     return this->volume;