how would you separate servos 13 and 12 from 10 and 11.
#include <Servo.h>
Servo servoLeft;
Servo servoRight;
Servo servoS;
Servo servoF;
void setup()
{
servoLeft.attach(13);
servoRight.attach(12);
servoS.attach(11);
servoF.attach(10);
}
void loop()
{
byte wLeft = digitalRead(5);
byte wRight = digitalRead(7);
if((wLeft == 0) && (wRight == 0))
{
forward(20);
}
else
{
forward(20);
}
}
void forward(int time)
{
servoLeft.writeMicroseconds(1700);
servoRight.writeMicroseconds(1300);
servoS.writeMicroseconds(1700);
servoF.writeMicroseconds(1300);
delay(time);
}
Separate_Servos1.ino (873 Bytes)