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

Increasing number of steps #28

Open sigmapi332 opened 2 years ago

sigmapi332 commented 2 years ago

This code works wonderfully, but I am attempting to utilize it and am needing a significant number of increase in steps to utilize it as I need. Your current code shows 4076 or 4096 steps per rev... but I am looking to do what I need in 11960 steps (long story short, it's for a DSLR star tracking mount and I need the increased speed to properly track stars at my specific camera lens size).

Would I just need to change the instances of 4076/4096 to the number of steps I need for my use of this?

Ex:

void set11960StepMode() { totalSteps = 11960; } void setTotalSteps (int numSteps) { totalSteps = numSteps; } // allows custom # of steps (usually 4076)

// blocking! (pauses arduino until move is done)
void move (bool clockwise, int numSteps); // 11960 steps = 1 revolution
void moveTo (bool clockwise, int toStep); // move to specific step position
void moveDegrees (bool clockwise, int deg);
void moveToDegree (bool clockwise, int deg);

I am not a very fluent coder, so pardon my ignorance on this. Any help you might be able to provide would be much appreciated!