digitalRead pins always read high but only when digitalWrite relies on it.

I'm trying to work through the projects in the Starter Kit (uno) box but I have a problem with the digitalRead pins always reading HIGH.
This continues even with the addition of what I understand to be a "pull down" resistor connecting the digitalRead pin to ground for when the switch is open.

I found a tutorial that allows me to 'Serial.print' the 'digitalRead' state and it seems to work fine, showing 0's when I don't press the button and 1's when I supply the pin with current.

When I add an "IF" statement to light an LED using a digitalWrite pin, the Serial.print shows that the digital.Read pin is now always HIGH and the LED is always on, whether I press the button or not!

/*
  DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor 
 
 This example code is in the public domain.
 */

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;
int led = 6;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT);
  pinMode (led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int buttonState = digitalRead(pushButton);
  if (pushButton = HIGH) {
    digitalWrite (led, HIGH);
    
  }
  else {
    digitalWrite (led, LOW);
  }
  // print out the state of the button:
  Serial.print(buttonState);
  delay(100);        // delay in between reads for stability
}

Any help would be greatly appreciated,
Thanks

  if (pushButton = HIGH) {

Oops. You forgot something.

= is assigment
== is comparison

Happens to all of us, tho less frequently with more practice.

CrossRoads:
= is assigment
== is comparison

Happens to all of us, tho less frequently with more practice.

He's using the pin to compare and not reading it's state.if (digitalRead(pushButton) == HIGH) {
Also, his loop() can be contracted to

void loop() {
  // set the LED to be in the same state as the pushButton
   digitalWrite (led,(digitalRead(pushButton)));
   // print out the state of the button, "0" or "1".
  Serial.print(digitalRead(pushButton));
  delay(100);        // delay in between reads for stability
}

Wow Thankyou guys!
This is the first time I've used this forum and I feel all warm and fuzzy for getting responses so quickly! Thankyou!
I will try your suggestions as soon as I'm home from work.

Thankyou all!
That solved my issues!