waspinator / AccelStepper

Fork of AccelStepper
http://www.airspayce.com/mikem/arduino/AccelStepper/
Other
146 stars 86 forks source link

Is there a bug in AccelStepper::step4? #2

Open yippieyaray opened 6 years ago

yippieyaray commented 6 years ago

Hi,

as far as I know is in a 4 phase full step mode, the value for the sequence zero 0b1010 and for sequence two 0b0101. You can find this sequences in lots of stepper theroy books too.

In AccelStepper.cpp I found the values in the comments but the coding differs.

void AccelStepper::step4(long step) { ... case 0: // 1010 setOutputPins(0b0101); <--- 0b1010 break; ... case 2: //0101 setOutputPins(0b1010); <--- 0b0101 break; ...

Regards, Ray

waspinator commented 6 years ago

Thanks for reporting the issue. The comments don't match up with the code, but the affect of switching those two values would only flip the definitions of "forward" and "backward".