Code required for data acquisition of couple tanks system with WSE sbc

Dependencies:   mbed mbedWSEsbc

Files at this revision

API Documentation at this revision

Comitter:
jdawkins
Date:
Mon Sep 19 12:04:31 2016 +0000
Parent:
1:a87d98b19444
Commit message:
Fixed overflow safety by removing break. Also changed safety values to 4.1 volts which is about 24 cm on the tank.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Sep 01 17:48:04 2016 +0000
+++ b/main.cpp	Mon Sep 19 12:04:31 2016 +0000
@@ -42,10 +42,9 @@
             float tank1 = read_max1270_volts(1, 1, 1);
 
             //Logic to exit loop if tank gets too full
-            if(tank1 > 4.0 || tank2 > 4.0) {
-                pc.printf("%.2f, %.3f, %.3f, %.3f\r\n", t.read(),tank1,tank2,pwm);
-                run_flag = false;
-                break;
+            if(tank1 > 4.1 || tank2 > 4.1) {
+                pc.printf("%.2f, %.3f, %.3f, %.3f\r\n", t.read() -log_start,tank1,tank2,pwm);
+                run_flag = false;               
             }