I'm working on a little project using 3 servos. They're powered with a bench power supply and I'm just going to make a program that runs once and then stops.
One of the servos is an mg996r that I converted to continuous rotation to function as a winch.
Ideally I'd like the whole routine to start when I press a button or flip a switch and to work using Millis but for now I'm just trying to get it working with delays.
This is the basic routine.
Servo1 rotates 45 degrees.
Servo2 Winch turns 360 for 3 or 4 revolutions.
Servo3 rotates 45 degrees
Servo1 rotates back and forth for a period of time.
Servo3 rotates back 45 degrees.
One problem I'm having is that I can't figure out how to rotate the winch and then stop it. If I get it spinning with:
It will spin but it won't stop. If I write myservo.write(90); and upload it will stop.
I want it to spin for a set time or a specific number of rotations (doesn't matter which) and then stop but I nodded it by glueing the potentiometer so its never finished spinning.
How do I write this? Can I make it spin for a set number of milliseconds only?