i'm an electronic engineering student, so i decided to start playiung with electronics learning how to control arduino. i bought the starter kit which includes a servo motor
#include <Servo.h>
Servo motorino;
int pos=0;void setup()
{
motorino.attach(9);
}void loop()
{
for (pos=0; pos<180;pos++)
{
motorino.write(pos);
delay(15);
}
for (pos=180;pos>0; pos--)
{
motorino.write(pos);
delay(15);
}
}
this is the code i wrote to control the servo, but it doesn't work at all: i've noticed that when i connect the servo to the GND pin as shown in this figure http://www.mauroalfieri.it/wp-content/uploads/2011/09/servo.png, the green ON led and the yello L led begin to fade.
Has anyone had the same problem?
P.S. the board is driven by the USB supply