tyhenry / CheapStepper

Arduino library for the cheap but decent 28BYJ-48 5v stepper motor with ULN2003 board
GNU General Public License v3.0
122 stars 46 forks source link

CheapStepper::move/newMove - numSteps should the long instead of int #2

Open matonym opened 7 years ago

matonym commented 7 years ago

At the moment CheapStepper::move has a parameter with the number of steps you want to step the motor. The numSteps parameter is defined as an int which only give you room to turn it maximum about 8 full revolutions. If this was defined as a Long instead we would have a lot of more possibilities.

These are the changes needed to be done: CheapStepper.cpp Row 49: void CheapStepper::move (bool clockwise, long numSteps) Row 91: void CheapStepper::newMove (bool clockwise, long numSteps){

CheapStepper.h Row 45: void move (bool clockwise, long numSteps); Row 63: void newMove (bool clockwise, long numSteps); Row 95: long getStepsLeft() Row 124: long stepsLeft = 0

This may affect the other functions as well, but I haven't tested those.

tyhenry commented 7 years ago

Thanks for noting this oversight.

I've updated the source to use unsigned long for the number of steps on branch long-steps. If you have a chance could you test it to make sure it's working properly (>8 revs).

I'll try to test soon myself. then I'll merge to master with 0.2.1 tag