How to make 2 (NEMA 17) motors run at the same time at the same speed with 2 A4988 drivers? Please answer
Are you referring to stepper motors? NEMA is National Electrical Manufacturers Association. The 17 refers to the mounting size of one of their thousand standards. So NEMA 17 defines only how something is mounted.
If you get one of your stepper motors to run, then the SAME process can be used for two or more steppers. There are lots of example programs for stepper motors. Did you find any that work for you?
also look up the AccelStepper library
To get two motors to run at the same time be sure to use non-blocking code - the second of my simple examples or the run() function in the AccelStepper library.
If they always run together, just connect both "Step" inputs to the same output pin. If they always run in the same direction, connect both "Direction" pins to the same output.
If you need to control them separately (like if they don't always run at the same speed), connecct the Step pins to separate output pins and send pulses to one right after the other:
digitalWrite(Stepper1Step_DOPin, HIGH); digitalWrite(Stepper2Step_DOPin, HIGH); digitalWrite(Stepper1Step_DOPin, LOW); digitalWrite(Stepper2Step_DOPin, LOW);