I want to turn on my motor and count how many total rounds it has until my limit switch is switched on. After that, I want to count rounds counterclockwise until another limit switch is pushed. For this, I'm using AccelStepper and ezButton lib.
Here is my code:
if ((limitSwitch_XV.getState() == LOW) && (limitSwitch_XE.getState() == LOW) && rightDirectionX) {
while (1) {
stepper1.step(-1);
stageSizeX++;
}
}
But here I've got an error which says that I can't use int
in step()
: 'virtual void AccelStepper::step(long int)' is protected within this context stepper1.step(1);
So how can I count the steps and go step by step to the given direction until I reach the limit switch with AccelStepper?