I'm running very basic code and my ESP8266 times out during the stepper motor function. I get a "Soft wdt Reset" about 1600 ms into the myStepper.step
function call.
The program works for a MyStepper.setSpeed
of 38, but not for 37. This happens on two out of two boards I've tried. Is there a way around this problem? I'm using the Arduino programming software, code is below.
#include <Stepper.h>
const int stepsPerRevolution = 200;
unsigned long startT;
// initialize the stepper library:
Stepper myStepper(stepsPerRevolution, 14, 12, 13, 15); //D5, D6, D7 & D8
void setup() {
// set the speed at in rpm:
myStepper.setSpeed(37); //38 good (~1571 ms), 37 bad (~1614 ms)
// initialize the serial port:
Serial.begin(9600);
Serial.println("Started stepper_oneRevolution_mk-------------------------");
}
void loop() {
startT=millis();
// step one revolution in one direction:
Serial.print("clockwise took: ");
myStepper.step(stepsPerRevolution);
Serial.println(millis()-startT);
delay(1000);
}