If you like to do more investigations on the accelStepper-problem
You could change the compile-log to maximum detail-output
like described in this tutorial.
Activating maximum details does help even in case that the code compiles
The thing I am most interested in is what version of the AccelStepper-library do you use?
On this board your code runs and runs
Maybe there is a problem through code-optimisation
The compiler can be adjusted to different levels of code-optimisations that might cause this problem if your loop has just this single function-call
stepper_y.runSpeed();
Your Arduino uno seems to be a QFP-chip clone too.
Step-pin is pin 4
and this code has an additional heartbeat-blinker that makes the onboard LED blink at 2 Hz.
Does the LED continue to blink even if you do not measure the 100 Hz step-pulse-frequency with your digital multimeter?
On my Arduino Uno the code runs and step-pulses are continually created
#include <AccelStepper.h>
#define step_y 4
#define dir_y 6
int led = 13;
AccelStepper stepper_y(1, step_y, dir_y);
void setup() {
pinMode(led, OUTPUT);
for (int n = 0; n < 5; n++) {
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
//stepper_y.setMinPulseWidth(200);
stepper_y.setMaxSpeed(1000);
stepper_y.setSpeed(100);
}
void loop() {
stepper_y.runSpeed();
BlinkHeartBeatLED(led,250);
//delayMicroseconds(800);
// delay(1); // alternativey use a 1 millisecond delay
}
// easy to use helper-function for non-blocking timing
boolean TimePeriodIsOver (unsigned long &startOfPeriod, unsigned long TimePeriod) {
unsigned long currentMillis = millis();
if ( currentMillis - startOfPeriod >= TimePeriod ) {
// more time than TimePeriod has elapsed since last time if-condition was true
startOfPeriod = currentMillis; // a new period starts right here so set new starttime
return true;
}
else return false; // actual TimePeriod is NOT yet over
}
unsigned long MyTestTimer = 0; // Timer-variables MUST be of type unsigned long
const byte OnBoard_LED = 2;
void BlinkHeartBeatLED(int IO_Pin, int BlinkPeriod) {
static unsigned long MyBlinkTimer;
pinMode(IO_Pin, OUTPUT);
if ( TimePeriodIsOver(MyBlinkTimer,BlinkPeriod) ) {
digitalWrite(IO_Pin,!digitalRead(IO_Pin) );
}
}
Interesting! I ran the heartbeat-blinker variant for half an hour and it didn't fall over. Produced the 100Hz signal the entire time. I set up a tripod to watch it