Open BiggRanger opened 6 years ago
Hi, I had the same issue, as can bee seen here in the forum.
However, I'd use a more compact code in the method itself:
{
digitalWrite(motor_pin_1, LOW);
digitalWrite(motor_pin_2, LOW);
if (this->pin_count >= 4) {
digitalWrite(motor_pin_3, LOW);
digitalWrite(motor_pin_4, LOW);
if (this->pin_count == 5) {
digitalWrite(motor_pin_5, LOW);
}
}
}
I second this commit. I would only suggest that idel() is called automatically after each run. Why should the user remember to idle the motor? Common sense dictate that the programmering should not leave the engine in a possible overheating situation.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
I've added an idle() method to power down the stepper motor pins in order to save energy or in my case allow a motor with a hand wheel to be manually operated. The only risk is if someone is keeping track of position by counting steps, while the motor is idle the motor may change position.