Laser-fototransistor sensor

hello,
SOmebody know why my code dosen’t work ?

#include <AccelStepper.h>

AccelStepper stepper1(AccelStepper::FULL4WIRE, 4, 5, 6, 7);
#define sensor 2
byte KORAK;

void setup() 
{
   Serial.begin(9600);
   pinMode(sensor, INPUT);
   stepper1.setMaxSpeed(150.0); 
   stepper1.setAcceleration(150.0);
   stepperHome();
   
} 
void loop()
{
 
  stepper1.moveTo(20000); //da dođe do sensora
  stepper1.runToPosition();
  delay(2000);
}
void stepperHome()
    {
      KORAK = digitalRead(sensor);
      while (KORAK = HIGH)
      {
        stepper1.moveTo(20000);
        stepper1.run();
        KORAK=digitalRead(sensor);
      }
      stepper1.setCurrentPosition(0);
    }

connection schema- 5V-RESISTOR-LASER-GND
5V-FOTOTRANSISTOR-RESISTOR-ARDUINO PIN 3-GND

tnx

Your first obvious blunder is here:

      while (KORAK = HIGH)

while (KORAK == HIGH) still fototransistor dosent work

Phototransistor wired the correct way around?

Start by making sure you read the phototransistor properly:

loop() {
  Serial.println(digitalRead(sensor));
  delay(500);
}

you should get a row of 1s and 0s depending on whether the phototransistor is conducting or not.