declaring a pushbutton

I don't know much about coding for arduino and copy pasted this code for controlling a dc motor with a transistor, i keep getting an error message saying "pushButton not declared in this scope" and cant seem to find an answer that works in google searches. Any guidance would be appreciated

void setup() {
  pinMode(pushButton, INPUT);
  pinMode(motorControl, OUTPUT);  
}

void loop() {

  // read the state of the button and check if it is pressed
  if(digitalRead(pushButton) == HIGH){ 
    // ramp up the motor speed
    for(int x = 0; x <= 255; x++){
      analogWrite(motorControl, x);
      delay(50);
    }

    // ramp down the motor speed
    for(int x = 255; x >= 0; x--){
      analogWrite(motorControl, x);
      delay(50);
    }    
  }

  delay(1);        // delay in between reads for stability
}

Which pin is the pushbutton connected to and how is it wired ?

The program does not know which pin you are using so you need to declare it before using it.

const byte pushbutton = 10;

at the top of the program if you are using pin 10 for instance. There are more subtleties than that but it should get you started.

  delay(1);        // delay in between reads for stability

After taking 25.6 seconds to ramp the motor up to full speed, and back down, do you REALLY think that an additional 0.001 seconds is going to make ANY difference?

Thanks for the replies, i'm going off of an arduino tutorial here: https://www.arduino.cc/en/Tutorial/TransistorMotorControl
it seems like the code there is incomplete

zspritz:
Thanks for the replies, i'm going off of an arduino tutorial here: https://www.arduino.cc/en/Tutorial/TransistorMotorControl
it seems like the code there is incomplete

No, it is perfectly fine. Look again.