I was tasked with making a program that could adjust a stepper motor to each individual step for a project. I haven't worked on coding much at all with the Arduino so I started with a bunch of the examples that came preloaded with the software, did a few hours of research, and ended up with a final product. Using the built in serial monitor in the software, I can send positive and negative values to the motor to cause it to rotate. Negative numbers cause it to rotate counterclockwise and vice versa. The magnitude of the number causes the motor to rotate. A stepper motor turns through "steps." This motor has 200 steps so if you send the value of 200 to the motor, it will rotate one full turn clockwise.
Pictures:
I bet you like my super advanced setup for what angle the motor is at.
Video:
Code:
If you're interested in the code, please email me at doitarduino@gmail.com. I'd be happy to share.