Separating Servos

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)

Crowbar?

They're already separate. Look at the forward function:

void forward(int time)                       
{
  servoLeft.writeMicroseconds(1700);        
  servoRight.writeMicroseconds(1300);
  servoS.writeMicroseconds(1700);
  servoF.writeMicroseconds(1300);      
  delay(time);                              
}

See how they use two separate statements, once for each servo. If you want to write to one and not the other then take out one of those. If you want to write them to different angles then change one.

Unless you've done something odd like gluing them together then they are already separate. You write whatever values you want to them individually.

Steve