Closed Carl-UB closed 9 months ago
Issue actually also occurs without external pins being used. Have updated the example repo and added tests using internal pins as well.
Yes. Apparently the initialization of the internal variables _enablePinHighActive
and _enablePinLowActive
are missing.
Could you please check, if this patch works as expected ?
Yep, looks like that has worked. Thanks!
When using an external enable pin, and with autoEnable on, running the stepper motors also controls pin 0.
Failing test & workaround with test here.
Seems likely to be due to the
_enablePinHighActive
being 0 by default and not being changed when setting enable pins. Could it be instead initialised toPIN_UNDEFINED
? It should still then be able to be set to a new value by the user but would avoid this bug.Workaround is to manually call
stepper->setEnablePin(PIN_UNDEFINED, false);
to set_enablePinHighActive
manually.I presume that
_enablePinLowActive
could have the same sort of problem, I haven't tested that.