remy il y a 3 ans
Parent
commit
ec937e16b1
2 fichiers modifiés avec 19 ajouts et 6 suppressions
  1. BIN
      Document/Conso.ods
  2. 19 6
      Soft/MCUnode/PeristatiqueV2/PeristatiqueV2.ino

BIN
Document/Conso.ods


+ 19 - 6
Soft/MCUnode/PeristatiqueV2/PeristatiqueV2.ino

@@ -2,7 +2,7 @@
 #include <TimeLib.h>
 #include <WidgetRTC.h>
 
-//#define AQUAGRA
+#define AQUAGRA
 //#define AQUAZOA
 
 #ifdef AQUAGRA
@@ -147,14 +147,22 @@ BLYNK_CONNECTED() {
 }
 
 BLYNK_WRITE(V60){
-  if (String("Ca") == param.asStr())
+  if (String("Ca") == param.asStr()){
     Blynk.virtualWrite(V3, STARTCa);
-  if (String("Kh") == param.asStr())
+    ML0=STARTCa;
+  }
+  if (String("Kh") == param.asStr()){
     Blynk.virtualWrite(V13, STARTKh);
-  if (String("Mi") == param.asStr())
+    ML1=STARTKh;
+  }
+  if (String("Mi") == param.asStr()){
     Blynk.virtualWrite(V23, (ML0+ML1)/2);
-  if (String("Mg") == param.asStr())
+    ML2=(ML0+ML1)/2;
+  }
+  if (String("Mg") == param.asStr()){
     Blynk.virtualWrite(V33, STARTMg); 
+    ML3=STARTMg;
+  }
 }
 
 
@@ -190,6 +198,7 @@ void AutoDistribue0(float ml){
   
   if (Auto0) {
     if(((ML0/4)*FACTEURML)>(1000*4)){
+      Active1(ML0/4);
     }
     else if((((ML0/2)*FACTEURML)>(1000*2))&(dist==0|dist==2)){
       Active0(ML0/2);
@@ -223,10 +232,11 @@ BLYNK_WRITE(V0) {
     Mesure0 = param.asFloat();
     return;
   }
-  Mesure0 = param.asFloat();  
+  Mesure0 = param.asFloat();
   
   ML0  = ML0 + (((ML0/Mesure0)* Cible0 - ML0)/4.0);
   MLForce0 = (Cible0-Mesure0)*FACTEUR0*LITRE;
+
   
   if(MLForce0<0)
     MLForce0=0;
@@ -308,6 +318,7 @@ BLYNK_WRITE(V8){
 void AutoDistribue1(float ml){
   if (Auto1) {
     if(((ML1/4)*FACTEURML)>(1000*4)){
+      Active1(ML1/4);
     }
     else if((((ML1/2)*FACTEURML)>(1000*2))&(dist==0|dist==2)){
       Active1(ML1/2);
@@ -424,6 +435,7 @@ BLYNK_WRITE(V18){
 void AutoDistribue2(float ml){
   if (Auto2) {
     if(((ML2/4)*FACTEURML)>(1000*4)){
+      Active1(ML2/4);
     }
     else if((((ML2/2)*FACTEURML)>(1000*2))&(dist==0|dist==2)){
       Active2(ML2/2);
@@ -506,6 +518,7 @@ BLYNK_WRITE(V28){
 void AutoDistribue3(float ml){
   if (Auto3) {
     if(((ML3/4)*FACTEURML)>(1000*4)){
+      Active1(ML3/4);
     }
     else if((((ML3/2)*FACTEURML)>(1000*2))&(dist==0|dist==2)){
       Active3(ML3/2);