I am learning the basics while trying to make a bit more complex project, at least for me it is complex.
I want to have a stepper motor controlled by the arduino (that is the easy part). When it hits a limit switch I want it to reverse direction until it hits the limit switch on the other side, and then reverse directions again.
I am thinking a flip flop will do the trick, but don't have a clue how to interface it with the stepper or the ardunio. Or could it be done by simply using two sitches in parallel on one pin, and a variable?
Electronically the motor and the limit switches are two seperate issues. Mechanically you have to have an actuator of some kind in the motor shaft or on whatever it drives to press the switches.
You don't need a FF or any external logic, just run the two switches into IO pins on the Arduino and test them before driving the motor.