If cicle that doesn't work

Hello everybody!
I'm tryng to make a program that controls soil humidity and water when it needs.
Here the sequence:
Power up the sensor
read the digital signal
if water is needed add it for 10 minutes
close the solenoid valve
go to the next sensor
power up...
The code I pasted doesn't exit from the if command until the sensor become HIGH.
Were is the error?
Thanks a lot!

digitalWrite(chocoA, HIGH);
delay(2000);
  if (digitalRead(chocolate) == HIGH) {
      digitalWrite(pumpChocolate, LOW); 
      delay(60000); //10 minutes about 330 mL
      digitalWrite(pumpChocolate, HIGH);
    }
  else {
//    delay(1000);
    digitalWrite(pumpChocolate, HIGH);
      delay(2000);
      }   
 delay(2000);
 digitalWrite(chocoA, LOW);
 delay(2000);

      digitalWrite(jaysA, HIGH);
      delay(2000);
        if (digitalRead(jays) == HIGH) {
              digitalWrite(pumpJays, LOW);
              delay(60000);
              digitalWrite(pumpJays, HIGH);
        } else {
         digitalWrite(pumpJays, HIGH);
         delay(2000);
         }
       delay(2000);    
       digitalWrite(jaysA, LOW);
       delay(2000);
delay(60000);

That line freezes the code for 10 minutes. Is that what you are talking about?

If not, then please describe the problem in terms of what happens and not what you think the code is doing.

I suspect that you might want to read up on analogRead() and adjust your code accordingly.

By the way, 60000 milliseconds is one minute.

vaj4088:
By the way, 60000 milliseconds is one minute.

Oops, sorry I didn’t count the zeros. I just took the comment’s word for it. -10 points for me.

void penance(int numLines){

for(int i = 0; i < numLines; i++){
   Serial.println("Never trust the comments");   // prints "Hello World" to the screen
}

}

After delay the program doesn't Close the solenoid valve unti the sensor become another time HIGH. unfortunately sensor is not Very accurate, And The program doesn't continue

And The program doesn't continue

The code looks like it was typed by a drunken monkey. Put EVERY { on a line BY ITSELF. Put EVERY } on a line BY ITSELF. Use Tools + Auto Format to sober that monkey up.

POST ALL OF YOUR CODE. Otherwise, you're just whining.