I am trying to program an Arduino Uno to control a stepper motor.
I need 3 buttons.
- Press it to turn the motor 1 step clockwise.
- Press it to turn the motor 1 step anticlockwise.
- Press it to turn the motor a set number of steps. This should only happen once per press of the button.
I have 2 sketches. One doesn’t have any code for the first 2 buttons and works as expected. It indexes as it should do.
The other sketch has extra lines of code for the jog buttons but they don’t work. Also, with this sketch, if the index button is pressed, the motor turns 1 step and then the other 400. If either of the jog buttons is pressed, nothing happens.
I used to have something very similar to this working years ago using the Button.h library but it doesn’t work anymore. That’s why I am now trying to get it working using the Pushbutton.h library instead.
Can anyone please offer advice to get the jog buttons working?
Thanks in advance.