Program for the water play project for the course Software Testing Practical 2016 given at the VU University

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Revision:
63:59335eb8bdbc
Parent:
62:52cceb263591
Child:
65:b277b4067d4a
diff -r 52cceb263591 -r 59335eb8bdbc PIDController.cpp
--- a/PIDController.cpp	Mon Jun 20 09:13:07 2016 +0000
+++ b/PIDController.cpp	Mon Jun 20 09:15:30 2016 +0000
@@ -20,7 +20,7 @@
     
     // Control the heater
     // This could be done in the pumping function as well, if needed
-    if (this->isHeating() && this->temp->getValue() >= TEMP_MIN_UNDESIRED + 1) {
+    if (this->isHeating() && this->temp->getValue() >= TEMP_MIN_UNDESIRED + 1.0f) {
         this->setHeating(false);
     } else if (!this->isHeating() && this->temp->getValue() < TEMP_MIN_UNDESIRED) {
         this->setHeating(true);
@@ -29,7 +29,7 @@
     float s = this->salt->getValue();
     float s_in_grams = this->getSaltInGrams();
     
-    if(s <= 6.0) {
+    if(s <= SALT_MIN_UNDESIRED) {
         
         float ml = this->getMlSaltyWater(s_in_grams, this->proximity->getValue());
         int ml_int = static_cast<int>(ml);
@@ -38,7 +38,7 @@
         
         //this->pump_salt_water(ml_int);
     
-    } else if(s >= 9.0) {
+    } else if(s >= SALT_MAX_UNDESIRED) {
 
         float ml = this->getMlFreshWater(s, this->proximity->getValue());
         int ml_int = static_cast<int>(ml);