Robin2:
You are using runSpeed() to move your motor and it does not implement acceleration. The run() function applies acceleration but it expects to know the total number of steps to be moved so that it can calculate the acceleration and deceleration.When you are not applying acceleration the AccelStepper library does not offer much benefit. It is not that difficult to control a stepper motor with your own code and your own acceleration code. See this Simple Stepper Code and this simple acceleration code.
Either way I suggest you write a short program just for testing and learning.
...R
That is what i understood, im not running to a specific position.. i need to be able to stop or change direction at anytime. So stepper run wouldnt work
I originally started with the simple stepper, i saw your acceleration code so many times but i couldnt understand how to use it with a potentiometer.
For limit switchs im using basic micro switchs with NC , NO and COM pins. 2 wires each limit switch, one goes to GnD of arduino, other wire goes to a input.