Progetto Serra Automatica

Dal tuo schema ho ricavato questo :

if (fcS_Chiuso && fcD_Chiuso) {
HC12.println("guasto entrambi finecorsa chiusi");
s = 99;
}
if (MotoreAvanti && MotoreIndietro) {
HC12.println("guasto doppio azionamento");
s = 99;
}
else if (s == 0 && comandoMotore == 1 && MotoreAvanti) {
t = millis();
s = 1;
}
else if (s == 0 && comandoMotore == 1 && MotoreIndietro) {
t = millis();
s = 2;
}
else if (s == 1 && MotoreAvanti) {
if (fcS_Chiuso && millis() - t >=3000) {
HC12.println("guasto fcs non apre");
s == 99;
fermaMotore();
s == 0;
  }
}
if (fcD_Aperto && millis() - t >=60000) {
HC12.println("guasto fcd non chiude");
s == 99;
fermaMotore();
s == 0;
}
else if (s == 2 && MotoreIndietro) {
if (fcD_Chiuso && millis() - t >= 3000) {
HC12.println("guasto fcd non apre");
s == 99;
  }
}
if (fcS_Aperto && millis() - t >= 60000){
HC12.println("guasto fcs non chiude");
s == 99;
fermaMotore();
s = 0;			
}
else if (s == 99){
HC12.print("Rilevato Guasto: ");
errore = 1;
}