What I'm trying to do is use the joystick to control direction of a stepper motor.
The push button of the joystick controls the step speed. Each time I click the button, the step speed changes giving me the control of slow, medium or high speed (which I need for a telescope focuser - this project).
it works, however as I cant see the motor, I don't know if the current state is slow, med or high. I would like to reference this either via leds for each state or a separate button to change the step speed so I know what it is currently.
Apologies if the code looks cr*p, it is a learning process I'm going through and it actually works well, apart from the speed reference I need to add.
Happy to learn form those more knowledgeable than myself so any input greatly appreciated.