   
 }
 
-void doStepY(int dirForY) {
+void doStepY(int dirForY) {   //stepper motor function for Y axis
   if(dirForY == 1) {
     switch(nextStepY) {
       case 1:

  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  
  pinMode(52, INPUT);  //Schalter
  pinMode(led, OUTPUT);  //laser
}

void loop() {
  
  int x = map(analogRead(A0),0,1023,1,100);
  int y = map(analogRead(A1),0,1023,1,100);
  
  while (Serial.available() > 0) {
    String RawRead = Serial.readStringUntil('\n');
    String BackWay = RawRead.substring(300);
    
    //Serial.print("I Read: ");
    //Serial.println(BackWay);
    
    String testDigit = RawRead.substring(0,1);
    contentString = RawRead.substring(0,300);
    
    testDigInt = testDigit.toInt();
    //Serial.print("testDig: ");

        delay(2);
      }
    }
    doStepX(1); // to step next for the laser mechanic
    
    Serial.write("k"); //write feedback for processing
    
  }// end of serial.available
  
  digitalWrite(9, LOW); //disable all motordrivers
  digitalWrite(10, LOW);  //disable all motordrivers
  digitalWrite(3, LOW); //disable all motordrivers
  digitalWrite(2, LOW); //disable all motordrivers
  
  if(digitalRead(52) == HIGH) { //if button is pressed...
    digitalWrite(led, HIGH);  // turn on laser
  }else digitalWrite(led, LOW); //if button is not pressed, turn off laser

  
  
  if(x > 60 || x < 40 || y > 60 || y < 40) {  // if joystick is moved enough...
    if(x > 60) {  // move axis when joystick is moved
      doStepX(1);
      //Serial.println("StepX 1");
    }
