Thanks for all the feedback.
I have tried to think about what you said and here is my result:
#include <Servo.h>
//Holds the servo ID
char bigChannel=0;
char smallChannel=1;
char gripperChar=0;
//These are the objects for each servo.
Servo servoBig
Servo servoSmall
Servo servoGripper
//This is the space that will hold data from the Serial port.
char serialChar=0;
//Attach servos to pins and give starting positions
void setup(){
servoBig.attach(2);
servoSmall.attach(3);
servoGripper.attach(4);
servoBig.write(90);
servoSmall.write(90);
servoGripper.write(0);
Serial.begin(9600); //Set up serial connection for 9600 btp.
Serial.write("Power On")
}
void loop()]{
if(Serial.available() > 1){ //Wait for data on the serial port.
serialChar = Serial.read(); //Copy one byte from serial buffert
if(serialChar == bigChannel){ //Check to see if the character is the servo ID
servoBig.write(Serial.read()); //set the Big motor to the recived position
gripperChar=gripperChar+1; //tell the gripper one servo have been moved
}
else if(serialChar == smallChannel){ //Check to see if the character is the servo ID
servoSmall.write(Serial.read());
gripperChar=gripperChar+1;
}
if(gripperChar == 2 ){ //gripper closes if the other servos have made 2 moves
delay(3000); //wait for the arm to be in position
servoGripper.write(180);
delay(2000); //wait for the gripper to make its move
}
else if (gripperChar == 4){ //gripper open when the other servos done another 2 moves
delay(3000)
servoGripper.write(0);
delay(2000);
gripperChar=0; //resets the gripperChar so the gripper will close after the next two moves
}
}
else{ //Arm to neutral position if there is no data waiting
if servoBig != 90;{
servoBig.write(90);
}
if servoSmall != 90; {
servosmall.write(90);
}
}
}