Hi Folks,
I'd like to use more (4 servos) in the same time. Everything's working fine when I connect my servos to my Arduio Mega board, but when I upload my sketch to the chip the servos just tremble and do not sweep. However if I connect only one servo the sketch is working like a charm and the servos are sweeping. I powered my ATMEGA chip and the servos from my Arduino board. I cannot find out what could be the problem please help me it is driving me crazy...
Many thanks!
Here's my very simple code:
#include <Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
int i = 0;
void setup() {
servo1.attach(3);
servo2.attach(5);
servo3.attach(6);
servo4.attach(9);
}
void loop() {
for (i = 0; i < 180; i++) {
servo1.write(i);
servo2.write(i);
servo3.write(i);
servo4.write(i);
delay(10);
}
for (i = 180; i > 0; i--) {
servo1.write(i);
servo2.write(i);
servo3.write(i);
servo4.write(i);
delay(10);
}
}