I'm new with arduino (nano). I am having problems with Servo MG90S, I cant make it move. Im doing the easiest test, Servo cables connected:
Brown -> gnd
Red -> 5v
Orange -> pin 9
my arduino code is:
#include <Servo.h>
Servo servo;
const int servoPin = 9;
void setup()
{
servo.attach(servoPin);
Serial.begin(9600);
}
void loop()
{
servo.write(40);
delay(2000);
servo.write(0);
delay(2000);
}
As you see its a super simple example, but the result is the servo vibrating slightly.
Extra data: the servo start vibrating with the servo.attach(servoPin); it doesnt matters if I set the servo.write(40);
Servo.write()is a value between 0 and 180, so -40 is not valid. Does is change something if you use 50 and 130 instead?