Recently I discover that the included Stepper Motor library do not have an option to stop the motor without energizing the coils. Wen it stops after doing de steps or setting the speed to zero it always keep some of the coils energized. This could overheat the motor and controller.
To solve this simply set the pins outputs of you motor to LOW.
Example:
digitalWrite(motor_pin_1, LOW);
digitalWrite(motor_pin_2, LOW);
digitalWrite(motor_pin_3, LOW);
digitalWrite(motor_pin_4, LOW);
Or you can alter your libary and include a "stop" function like this:
In the file Stepper.h on "public:"
void stop(void);
In file Stepper.cpp just at the end:
void Stepper::stop(void)
{
if (this->pin_count == 2) {
digitalWrite(motor_pin_1, LOW);
digitalWrite(motor_pin_2, LOW);
}
if (this->pin_count == 4) {
digitalWrite(motor_pin_1, LOW);
digitalWrite(motor_pin_2, LOW);
digitalWrite(motor_pin_3, LOW);
digitalWrite(motor_pin_4, LOW);
}
}
Of course if you want the motor to keep its position or to break you will not use this.
I hope I helped someone.