"was not declared in this scope" and I don't get why

I really don’t understand why it tells me that buttonPin is not declared.
Itried everything.
I put the line “int butttonPin = 1;” in every spot imaginable.

int fetPin =  A0;      
int butttonPin = 1;
int increasePin = 2;
int decreasePin = 3;
int sensorValue = analogRead(A1);

int fetState = LOW;    

int increaseState = LOW;
int decreaseState = LOW;
int currentMillis = 0;
int previousMillis = 0;        
int interval = 50;    
int val = 0;




void setup() {
  Serial.begin(9600);
pinMode(fetPin, OUTPUT);
pinMode(butttonPin, INPUT);  
}

void loop()
{
  {
  if(digitalRead(buttonPin == HIGH)
    fetState = HIGH;
    else{
      fetState = LOW;
    digitalWrite(fetPin, fetState);
    unsigned long int currentMillis = millis();
  }
 
    if(currentMillis - previousMillis > interval) {
      previousMillis = currentMillis;
      fetState = LOW;
      digitalWrite(fetPin, fetState);
    }
    if(increasePin == HIGH)
      interval + 5;
    if(interval > 500)
      interval = 500;
    if(decreasePin == HIGH)
      interval - 5;
    if(interval < 20)
      interval = 20;
    digitalWrite(fetPin, fetState);
  }
}

int fetPin =  A0;      
int butttonPin = 1;
int increasePin = 2;
int decreasePin = 3;
int sensorValue = analogRead(A1);

int fetState = LOW;    

int increaseState = LOW;
int decreaseState = LOW;
int currentMillis = 0;
int previousMillis = 0;        
int interval = 50;    
int val = 0;




void setup() {
  Serial.begin(9600);
pinMode(fetPin, OUTPUT);
pinMode(butttonPin, INPUT);  
}

void loop()
{
  {
  if(digitalRead(buttonPin == HIGH)
    fetState = HIGH;
    else{
      fetState = LOW;
    digitalWrite(fetPin, fetState);
    unsigned long int currentMillis = millis();
  }
 
    if(currentMillis - previousMillis > interval) {
      previousMillis = currentMillis;
      fetState = LOW;
      digitalWrite(fetPin, fetState);
    }
    if(increasePin == HIGH)
      interval + 5;
    if(interval > 500)
      interval = 500;
    if(decreasePin == HIGH)
      interval - 5;
    if(interval < 20)
      interval = 20;
    digitalWrite(fetPin, fetState);
  }
}

buttton != button

int butttonPin = 1;

You got 3 t’s there…

But only 2 here…

if(digitalRead(buttonPin == HIGH)

Thanks you guys.

I was looking at this for 2 hours and didn't see it.

You can use the search facility of the IDE to save time.

Is your button on the digital 1 or analog A1? You have Serial.begin(9600); in your code and if you have anything on 0 or 1 (digital pin) you may have problems.

HazardsMind: Is your button on the digital 1 or analog A1? You have Serial.begin(9600); in your code and if you have anything on 0 or 1 (digital pin) you may have problems.

Thanks. I was only using analog pins. But while trying everything possible, I changed even that. So I should not use digital Pins 0 and 1?

Is there a tutorial of general tipps like that? Also, is there a function library that I can look at, like in excel? It's my first time programming something. I wish I made faster progress. I've spent 12 hours on not even one page of code and it doesn't even do, what I want. I feel like I'm back in primary school ;-)

I've spent 12 hours on not even one page of code and it doesn't even do, what I want.

It is said that when taken over all a professional programmer produces less than ten lines of code a day. That is code that remains in the project at the end.

Thanks. That makes me feel a lot better.

My average is still very good so :-)

And the really sad thing is, that figure hasn't changed in the last thirty years. Maybe the individual lines do more than they did all that time ago, but it is still a pretty poor statistic.

  if(digitalRead(buttonPin == HIGH)

Pssst. Wrong.

And the really sad thing is, that figure hasn't changed in the last thirty years.

Between meetings, incomplete requirements, poor documentation, etc., I don't find that figure all that surprising. Though I think I do better than that.