I'm currently expanding on a previous student's project using a 2560 board to control one stepper motor. I got everything connected but for some reason there is no current running through and so the motor is not moving at all. I am trying to move the motor over a specified duration of time with the maximum amount of microstepping (1/32). I'm very new to Arduino so if I'm missing anything please let me know! Any help is appreciated. I have attached my code and current schematic of my setup.
#include <AccelStepper.h>
#define M0 4
#define M1 5
#define M3 6
AccelStepper stepper1(1, 23, 22);
float maxspeed = 100;
int maxacceleration = 12000;
long direction = 1;
long maxsteps = 37000;
void setup() {
pinMode(M0, OUTPUT);
pinMode(M1, OUTPUT);
pinMode(M3, OUTPUT);
digitalWrite(M0, HIGH);
digitalWrite(M1, HIGH);
digitalWrite(M2, HIGH);
stepper1.setMaxSpeed(maxspeed);
stepper1.setAcceleration(maxacceleration);
stepper1.moveTo(direction*maxsteps);
}
void loop() {
stepper1.run();
}