I'm building a railroad X-Ing and I need these features:
A stepper motor (not a servo) to lower a barrier (motor: 28BYJ-48 with a ULN2003 controller). If it is activated the motor (with a shaft attached), will turn 90 degrees to the left, and when it becomes deactivated, it returns to its original position (straight up)
While activated it has 2 LED's and 2 buzzers going off simultaneously
How can I write the code so I can control the stepper motor? I know how to code the LED's to flash, but not the stepper motor.
A servo would be much easier to use because a stepper motor does not know where it is when the Arduino is first powered up and you will need a limit switch and suitable code to make the motor move to the switch to establish the Zero position.
If the problem is that a servo moves too quickly have a look at the servo sweep example that comes with the Arduino IDE.
If your Arduino will be doing other things as well as moving the barrier you may find the demo Several Things at a Time useful. It also includes servo code and flashing LEDs