isRunning = false;
if (millis() - millisLastMove > millisDisableDelay)
{
// Save current location in EEPROM
if (lastSavedPosition != currentPosition)
{
EEPROM.put(0, currentPosition);
lastSavedPosition = currentPosition;
debugSerial.println("Save last position to EEPROM");
stepper.disableOutputs();
debugSerial.println("Disabled output pins");
}
}
the stepper is not disabled if the lastSavedPosition is identical to currentPosition. I ran into this when testing, it is unlikely to occur in real life.
A simple solution may be to pull the disableOutputs() line out of the if command.
In the code
the stepper is not disabled if the lastSavedPosition is identical to currentPosition. I ran into this when testing, it is unlikely to occur in real life.
A simple solution may be to pull the disableOutputs() line out of the if command.