too few arguments to function error in nested for loop

I want Arduino to run a pump, valve and two LEDs.

  1. Valve is on, pump is on, first LEDs is on for 90 sec.
  2. Everything is off for 90 sec.
  3. Valve is on, pump is on, second LEDs is flashing 5 us on, 50 millisecond off. The duration of this step 90 second.
  4. Everything is off for 90 sec
    I want to repeat steps 1-4 4 times and after that
    Valve is on, pump is on. for 90 sec.
    Everything is off for 90 sec.
    Valve is on, pump is on. for 90 sec.
    Everything is off for 90 sec.
    Then I want to exit for loop.
    I wrote a code with nested for loop and I’m getting an error
    In function ‘void loop()’:
    43:20: error: expected ‘)’ before numeric constant
    43:22: error: too few arguments to function ‘void analogWrite(uint8_t, int)’
    1:0:
    139:6: note: declared here

I marked the raw with error in RED.
int button1Pin = 2;
int pumpPin = 11;
int valvePin = 10;
int ledPin = 13;
int rledPin = 9;
int iledPin = 8 ;
int button1State = 0;
void setup()
{
pinMode(button1Pin,INPUT);
pinMode(valvePin,OUTPUT);
pinMode(ledPin,OUTPUT);
pinMode(pumpPin,OUTPUT);
pinMode(rledPin,OUTPUT);
pinMode(iledPin,OUTPUT);
}
void loop (){
button1State = digitalRead(button1Pin);
if (button1State == LOW) {
digitalWrite(ledPin,HIGH);
}
else{
for (int x=0; x<5; x++){
analogWrite(valvePin,250);
analogWrite(pumpPin,250);
analogWrite(rledPin,250);
delay(90000);
analogWrite(rledPin,0);
analogWrite(valvePin,0);
analogWrite(pumpPin,0);
delay(90000);
for (int i=0; i<3600; i++){
analogWrite(pumpPin,250);
analogWrite(rledPin,250);
digitalWrite(iledPin,HIGH);
delayMicroseconds(5);
digitalWrite(iledPin,LOW);
delay(25);
}
analogWrite(valvePin,0);
analogWrite(pumpPin.0);
delay(90000);
if ( x==5 ) {
analogWrite(valvePin,250);
analogWrite(pumpPin,250);
delay(90000);
analogWrite(valvePin,0);
analogWrite(pumpPin,0);
delay(90000);
analogWrite(valvePin,250);
analogWrite(pumpPin,250);
delay(90000);
analogWrite(valvePin,0);
analogWrite(pumpPin,0);
delay(90000);
if (x>5) {
analogWrite(valvePin,0);
analogWrite(pumpPin,0);
delay(10000000);
}
}
}
}
}

Your indenting is atrocious. First, hit ctrl-t in the Arduino IDE. Then repost the code using Code Tags.

Hi and welcome to the forum! Can you please post your code in code tags ( </> ) and before posting please Auto Format your code in the IDE ( Ctrl + T ) to make your code neater! Thank you!

Line 41, instead of:

analogWrite(pumpPin.0);

Change it to:

analogWrite(pumpPin, 0);

TheUNOGuy:
Line 41, instead of:

analogWrite(pumpPin.0);

Change it to:

analogWrite(pumpPin, 0)

Thank you very much!!! I’ve spent at least three hours trying to find the
problem. I was  actually testing my code in TinkerCad. I will run through Arduino  EDA.

int button1Pin = 2;
int pumpPin = 11;
int valvePin = 10;
int ledPin = 13;
int rledPin = 9;
int iledPin = 8 ;
int button1State = 0;
void setup()
{
  pinMode(button1Pin, INPUT);
  pinMode(valvePin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(pumpPin, OUTPUT);
  pinMode(rledPin, OUTPUT);
  pinMode(iledPin, OUTPUT);
}
void loop () {
  button1State = digitalRead(button1Pin);
  if (button1State == LOW) {
    digitalWrite(ledPin, HIGH);
  }
  else {
    for (int x = 0; x < 5; x++) {
      analogWrite(valvePin, 250);
      analogWrite(pumpPin, 250);
      analogWrite(rledPin, 250);
      delay(90000);
      analogWrite(rledPin, 0);
      analogWrite(valvePin, 0);
      analogWrite(pumpPin, 0);
      delay(90000);
      for (int i = 0; i < 3600; i++) {
        analogWrite(pumpPin, 250);
        analogWrite(rledPin, 250);
        digitalWrite(iledPin, HIGH);
        delayMicroseconds(5);
        digitalWrite(iledPin, LOW);
        delay(25);
      }
      analogWrite(valvePin, 0);
      analogWrite(pumpPin, 0);
      delay(90000);
      if ( x == 5 ) {
        analogWrite(valvePin, 250);
        analogWrite(pumpPin, 250);
        delay(90000);
        analogWrite(valvePin, 0);
        analogWrite(pumpPin, 0);
        delay(90000);
        analogWrite(valvePin, 250);
        analogWrite(pumpPin, 250);
        delay(90000);
        analogWrite(valvePin, 0);
        analogWrite(pumpPin, 0);
        delay(90000);
        if (x > 5) {
          analogWrite(valvePin, 0);
          analogWrite(pumpPin, 0);
          delay(10000000);
        }
      }
    }
  }
}

Yep now your code looks way neater! I hoped you solved your problem! Enjoy!