Here is some code to demonstrate using a single stepper motor, an Uno, the Adafruit Motor Shield and a three-way switch. The middle position of the switch is OFF. One side rotates the motor until stopped and the other side rotates the motor ±45°. I built this with one of my students to allow honeycombs to be dried. Sorry I cannot show a picture of the finished product ?.
Power is from a 9V, 3A supply which is also converted to 5V for the Uno. The switch is connected with screw connectors mounted directly on the motor shield.