RFID RC522 and stepper motor 28BYJ-48

In this project I would like to RFID my card and after its identification proceed to run stepper motor. But for some reason the motor is not activated. Why? If I use an example sketch for stepper motor the connection is set properly. Here is partial sketch, because the sketch is too long. Please refer to attachment.

else {
    if ( isMaster(readCard) ) {  // If scanned card's ID matches Master Card's ID enter program mode
      programMode = true;
      Serial.println("Hello Master - Entered Program Mode");
      int count = EEPROM.read(0); // Read the first Byte of EEPROM that
      Serial.print("I have ");    // stores the number of ID's in EEPROM
      Serial.print(count);
      Serial.print(" record(s) on EEPROM");
      Serial.println("");
      Serial.println("Scan a PICC to ADD or REMOVE");
      Serial.println("-----------------------------");  
  //else{
  //  if(findID(readCard)){           // If not, see if the card is in the EEPROM 
        Serial.println("Welcome, You shall pass");

        
   /***********************************
       COMMAND FOR STEPPER MOTOR
   ***********************************/
 Serial.println("START STEPPER");
  if (stepper.isDone() && rotate1 == false)  
  {  
    delay(2000);  
    //Define o sentido de rotacao (CW = Horario)  
    stepper.setDirection(CW);  
    //Define o numero de rotacoes  
    stepper.rotate(2);  
    rotate1 = true;  
    delay(2000); // Hold green LED on for 2 more seconds
  }
  if (stepper.isDone() && rotate1 == true)  
  {  
    delay(2000);  
    //Define o sentido de rotacao (CCW = Anti-horario)  
    stepper.setDirection(CCW);  
    //Define o numero de rotacoes  
    stepper.rotate(2);  
    rotate1 = false;  
  }
  
  stepper.run();   
  openDoor(6000);                  // Open the door lock for 300 ms

   // If not, show that the ID was not valid
        Serial.println("You shall not pass");
        failed(); 
      }
  }
}

RFIDDoorLockVersion1.ino (19.9 KB)

But for some reason the motor is not activated. Why?

What do your Serial.print() statements tell you is happening?

      Serial.println("!!! Starting Wiping EEPROM !!!");

I'd recommend that you never buy a Mega. You'll be very disappointed if you do. Unless you wise up. "!!! Starting Wiping EEPROM !!!" conveys NO more information than F("Starting EEMPROM") does, but wastes SRAM and takes longer to send.

Thanks. I am using an Arduino UNO actually to transfer a sketch. But this part of code is actually saying Serial.println("START STEPPER");

Actually, a DC motor is working just fine with RFID. I put a delay to make it turn one side for 6 sec and after it turns opposite side for the same delay of time. But how could I incorporate a sketch with a stepper motor in? Any idea.