Salinity and temperature sensors are implemented in classes.

Dependencies:   mbed

Revision:
8:6be230b22314
Parent:
7:46e65aeb4df2
Child:
9:a12f15260c67
--- a/Tank.cpp	Sun Jun 19 23:48:07 2016 +0000
+++ b/Tank.cpp	Mon Jun 20 10:02:45 2016 +0000
@@ -100,21 +100,15 @@
 }
 void Tank::react(double salinity)
 {
-    if(salinity < 0.0) {
-        // add more pure water
-        add(TYPE_SALT, 1, DIRECTION_PULL);
-        add(TYPE_SALT, 1, DIRECTION_PUSH);
-        add(TYPE_SALT, 2, DIRECTION_PULL);
-        add(TYPE_SALT, 2, DIRECTION_PUSH);
-        add(TYPE_SALT, 3, DIRECTION_PULL);
-        add(TYPE_SALT, 3, DIRECTION_PUSH);
-    } else {
-        // add more saline solution
-        add(TYPE_PURE, 1, DIRECTION_PULL);
-        add(TYPE_PURE, 1, DIRECTION_PUSH);
-        add(TYPE_PURE, 2, DIRECTION_PULL);
-        add(TYPE_PURE, 2, DIRECTION_PUSH);
-        add(TYPE_PURE, 3, DIRECTION_PULL);
-        add(TYPE_PURE, 3, DIRECTION_PUSH);
-    }
+    char buffer[32];
+    sprintf(
+        buffer,
+        "salinity: %3.2F",
+        salinity
+    );
+    _printer.toSerial("here");
+    
+    //this->add(TYPE_PURE, 2.0, DIRECTION_PUSH);
+    //wait(2);
+    //this->add(TYPE_PURE, 4.0, DIRECTION_PULL);
 }
\ No newline at end of file