I am making a robot and and bought an MG90s servo, but unfortunately it is a modified servo (continuous rotation servo). I don't need 360° and these servos cannot be rotated by myservo.write()
and in my project I need it to rotate not more than 180°.
Can anyone help me with the code to move the servo to a certain position? I learned that with myservo.writeMicroSeconds(1500)
we can rotate the servo to the middle, so could someone tell me what the values for 0 and 180 are (so that I can use the map()
command to do the remaining), and please tell me if the servo can hold position!
The PWM signal you send to a Continuous Rotation Servo will determine its turning direction and speed, and not its position.
What you want to do can't be done; you will either have to un-modify your servo or buy an unmodified one.