this is not my first time that work with servo motor on arduino mega adk, but this time something went wrong! I'm connecting my servo Motor to an arduino as it should be. and then I wrote my code as mentioned here:
#include <Servo.h>
Servo monServo;
void setup()
{
monServo.attach(7, 1000, 2000);
monServo.write(45);
}
void loop()
{
}
but my servo doesn't work correctly, it doesn't turn 45° but it turn into it's max value and then begin to make noise as it wants to turn more. I thought that the problem is from the servo motor but I tried this with 3 different motors but the same result. From where this issue is comming from?
You could have an issue with the power supply. Try powering the Arduino with a wall power supply instead of using the USB port. You can also add a large capacitor in series with the servo. See "If the servo misbehaves"