Stepper Motor and Light Sensor

Hi all. I am currently trying to control a stepper motor with buttons and a light sensor. In my code I can make the stepper motor turn clockwise and counterclockwise using the buttons but when I try to use the light sensor nothing happens. I am attaching my code. I can not find the error in my code so I someone can help I would greatly appreciate it!

BLIND.ino (1.26 KB)

Which light sensor do you have and how is it connected? What values are printed for "sensorValue"? Post a drawing.

OP’s program - to make it easier for people to help

#include <Stepper.h>
#include <math.h>
const int sensor = A0;
int numberofstep = 600;
const int buttonPin = 4;
const int buttonPin1 = 5;
const int ledPin =  13;
int buttonState = 0;
int buttonState1 = 0;
Stepper motor(numberofstep, 9, 11, 10, 6);
int STATE = 0;
int THREASHOLD = 100;

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
  pinMode(buttonPin1, INPUT);
  motor.setSpeed(40);
  Serial.begin(9600);
}

void loop() {
  int sensorValue=analogRead(sensor);
  Serial.println("the analog read data is ");//print on the serial monitor what's in the ""
  Serial.println(sensorValue);// print the value of the sensor on the serial monitor
  delay(1000);
  buttonState = digitalRead(buttonPin);
  buttonState1 = digitalRead(buttonPin1);

  if (buttonState == HIGH){
    motor.step(2048);
    digitalWrite(ledPin, HIGH);
    buttonState = LOW;
    STATE = 1;
  }
  else if (buttonState1 == HIGH) {
    motor.step(-2048);
    digitalWrite(ledPin, HIGH);
    buttonState1 = LOW;
  }
  else if ((sensor > THREASHOLD) && (STATE == 0)) {
    motor.step(2048);
    STATE = 1;
  }
  else if ((sensor < THREASHOLD) && (STATE == 1)) {
    motor.step(-2048);
    STATE = 0;
  }
  else {
    digitalWrite(ledPin, LOW);
  }
}

…R