The servo is micro servo 9g SG90 (the datasheet says the power supply is ~5V).
Issue:
Servo is not moving and keeps on making clicking sounds like a computer mouse click.
I have tried:
looked into the Appdata folder, and found out that the Servo.h is in the right place.
reconnecting USB of arduino.
reseting arduino.
restart IDE.
Code:
# include <Servo.h>
int power=7;
int control=9;
Servo myServo;
void setup() {
// put your setup code here, to run once:
myServo.attach(control);
pinMode(power,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(power,HIGH);
myServo.write(position);
}
Are you trying to supply 5V to a servo requiring 650 +/- 80 mA stall current from an Arduino Uno output pin that is spec'd to supply 20mA under normal operating conditions?
Note that the Arduino's 5V output can not supply enough current to make the servos work correctly and reliably. You need to use an external power supply capable of supplying at least an amp.