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
Diff: PIDController.cpp
- Revision:
- 47:a73b8640fb60
- Parent:
- 46:7e4c1f2ab76c
- Child:
- 49:ca6fb19fc280
--- a/PIDController.cpp Wed Jun 15 10:55:44 2016 +0000 +++ b/PIDController.cpp Wed Jun 15 11:31:18 2016 +0000 @@ -109,6 +109,7 @@ float PIDController::getMlSaltyWater(float gramsinbody, float volumeinbody) { + float solutiongramperten = 1.16f; // 1.0f for our solution float solvolume = 10; // 10ml float idealpptconstant = 0.007f; //7 ppt / 1000 @@ -116,7 +117,7 @@ float x2 = solvolume * idealpptconstant; x1 = x1 - gramsinbody; - x2 = 1 - x2; + x2 = solutiongramperten - x2; float outputml = (x1 / x2 * solvolume);