Servo Motor Error!!

I prepared a project that I have to submit tomorrow, it’s an obstacle avoiding robot with 4 motors, a sensor, leds, a buzzer, and a servo motor. When I try to adjust the servo angle using myServo.write(); it keeps on turning continuously instead of taking the angle, although it is a standard servo that turns 180 degrees… Please help me!

reem_yd:
it keeps on turning continuously instead of taking the angle, although it is a standard servo that turns 180 degrees..

If it really was a standard servo it is now broken. My guess is that you are using a continuous rotation servo.

Try using a different servo.

If that does not help then you need to post your code.

You should not be at this stage with a project that needs to be submitted tomorrow - start preparing your excuses :slight_smile:

...R

It is a standard servo and it had worked well before. Don’t know what happened

I used a simple code aside to try it and it kept on turning (myServo.write(90):wink:

download a servo sweep program and modify it to attach to the pin you servo is on.
If it spins continuously, then you have broken hardware.
Replace the servo.

Or submit your project with the note that the hardware failed, with the test I described above to demonstrate the failure.

A working standard servo cannot turn continuously. A dead one can if it's lost feedback, perhaps because the internal gears are broken. Replace it.

Steve

A standard servo has usually a physical stop, a small peg, that prevents the gear from rotating too far. This peg must be broken. Figure out how your broken servo works and try your best to rotate it to where you want, by testing and timing. If you get anywhere near, you might get special credit for your homework by clever usage of broken hardware.