I have a project where i want to control a stepper motor with a 2-way toggle switch for direction and a potentiometer for the adjustment of its speed.I havent yet written the code for the speed control.
The problem that i am facing is that when i connect the toggle switch as shown in the attachment Switch_1.jpg the motor rotates randomly, no matter the position of the switch.
I cant figure out whether i made a circuit or programming mistake.
The program that i am using is attached.
Thanks in Advance!
P.S. I dont have much knowledge on arduino programming and electronic circuits
Stepper_Direction_v1.ino (590 Bytes)