Arduino uno R3 + CNC shield v3 + A4988 + Stepper motor driver programming

I have Arduino Uno R3, CNC Shield V3 and A4988 driver. I'm trying to make a simulator room and I want the doors to close with stepper motor (Nema 14). How do I program the doors close when I want from computer and open again. I have already created the mechanism so I just need to know how to program it with arduino.
Thanks!

My main language isn't English so don't get confused

How do I program the doors close when I want from computer and open again.

How is the request to close the doors, or to open the doors, going to get from the computer to the Arduino?

Ethernet? WiFi? Serial? Smoke signals?

Serial

Micu:
Serial

So, what is sending the request, and what does the request look like?

It is far different to deal with "Pretty please, would you open the door?" than with "" or to deal with "Shut the freaking door. It's freezing in here" than with "".

Take a look at a sketch designed for controlling a A4998 stepper driver. The code basically sets the direction of the motor with one pin, and writes high then low on the step pin to move the motor one step.

Take a look at this example for the basics of how a A4998 controls a stepper and how you wire it up:

You will need to determine which pins your A4998 is hooked up to your Uno on your CNC driver board and modify the sketch appropriately to the correct pins. After you get it working and running your motor one direction and then the other, you will have to decide how you wish to control it.

I think you will need to accomplish at least 2 things in your code;

  1. set motor direction appropriately for open or close
  2. write to the step pin the correct number of steps to open or close the door.

You might want to incorporate some feedback by having end switches that are activated once the door is fully open or fully closed, to stop the loop that writes to the step pin.