Recently I bought 4 MG958 Servo's. I connected the servo to a separate power supply. (5V constant voltage). I used a standard test servo code called sweep. When I start up the Arduino the servo won't turn and makes a clicking noise. All 4 servo's do this. (I don't turn all 4 servo's at the same time, I use 1 just to test.)
I hope someone wants to help me solve this problem.
It does sound like a power/wiring problem but that PSU should be fine.
How is everything connected together? I hope you're not using any high resistance connections like breadboards or croc clips for the servo power/ground. Can you post a photo of your setup showing all the wiring?
If you try an even simpler program that just writes a few values to the servos does that also fail? E.g.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(0);
delay(500);
myservo.write(90);
delay(500);
myservo.write(180);
delay(500);
}
void loop() {
}
Well the startup current of that servo could easily be around 1.5A and that's a lot to get through breadboard connections, which are not the greatest. Try it with the + and - servo connections direct to the power supply terminals just to see if it makes a difference.
Otherwise it's always possible you have some dead servos. Do you have any other way to test the servos? RC receiver or a standard servo tester perhaps?