hi , im using 4 servos to make a walking robot, the issue is only the first servo is running , currently i have written code only for 2 servos to check the motion of the legs movement, but the second second servo is not at all moving and the first servo is moving once and stopping, im using arduino uno, with 5v power adapter
here is the code
#include <Servo.h>
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
void setup() {
// put your setup code here, to run once:
servo1.attach(3);
servo2.attach(4);
servo3.attach(5);
servo4.attach(6);
servo1.write(90);
servo2.write(90);
servo3.write(90);
servo4.write(90);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i= 120;i>=70;i-=0.2){
servo1.write(i);
delay(100);
if(i==70){
break;
}
}
delay(10);
for (int i= 70;i<=120;i+=0.2){
servo2.write(i);
delay(100);
if(i==120){
break;
}
}
delay(10);
}