Compilar um programa

oi,sou novato na programação em arduino e ao compilar este programa dá erro será que me poderiam resolver a questão desde já obrigada.

// this constant won't change:
const int  buttonPin = 5; // the pin that the pushbutton is attached to

// Variables will change:
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin, INPUT);
  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
  // read the pushbutton input pin:
  buttonState = digitalRead(buttonPin);
  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:    
      Serial.println("Headlights");
      delay (1000);
    } 
  }

  buttonState = digitalRead(buttonPin2);

  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:    
      Serial.println("Windshield Wipers");
      delay (1000);
    } 
  }

  buttonState = digitalRead(buttonPin3);

  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:    
      Serial.println("Pit Speed Limiter");
      delay (1000);
    } 
  }

  buttonState = digitalRead(buttonPin4);

  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:    
      Serial.println("Start Engine");
      digitalWrite(led, HIGH);
      //delay (10);
      digitalWrite(led, LOW);
    }

  }
  // save the current state as the last state, 
  //for next time through the loop
  lastButtonState = buttonState;
}

Está faltando várias variáveis chamadas buttonPin2, buttonPin3, buttonPin4, e levou.

Quando você tenta compilar ele dá um monte de erros declarando algo como

33:29: erro: 'buttonPin2' não foi declarado neste âmbito

Que diz na linha 33 foi referancing buttonPin2 que não foi declarada como uma variável.

Adicionando estas linhas ao topo irá declarar as variáveis e allw-lo para complie.

int buttonPin2 = 2;
int buttonPin3 = 3;
int buttonPin4 = 4;
int levou = 6;

Im usando o google para traduzir isso como eu não falam português. desculpe se é difícil de ler.

oi preciso da vossa ajuda, eu tambem sou novo na programacao com arduino, o meu codigo tambem esta a dar o mesmo erro: sensor = analogRead(A5); nao declarado neste ambito.

int bomba = 8;

#define SP 95

void setup() {
Serial.begin(9600);
pinMode (A5, INPUT);
pinMode (8, OUTPUT);

}

void loop() {
sensor = analogRead(A5);

if (sensor > SP){
digitalWrite (bomba,HIGH);
}
else{
digitalWrite (bomba, LOW);
}
Serial.print("valor do sensor de humidade do solo: ");
Serial.println(sensor);
delay(1000);

}