Servo Control

Hi I need a little help

I want to control a servos through serial communication. I write a code for controlling one servo control, but i dont know how to control multiple servos.
This is my code for one servo

String readString;
#include <Servo.h>


Servo myservo1;  // create servo object to control a servo
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;
Servo myservo6;// a maximum of eight servo objects can be created


char a;
int pos = 0;    // variable to store the servo position
 
void setup() 
{
  myservo1.attach(3);  // attaches the servo on pin 9 to the servo object
  myservo2.attach(5);
  myservo3.attach(6);
  myservo4.attach(9);
  myservo5.attach(10);
  myservo6.attach(11);  
  
  Serial.begin(9600);
  
}
void loop()
{
  char dat;


while (Serial.available()) {
    delay(1); 
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      readString += c; //makes the string readString
    } 
}

  if (readString.length() >0) {
    //Serial.println(readString);  //so you can see the captured string 
    int n;
    char carray[6]; //converting string to number
    readString.toCharArray(carray, sizeof(carray));
    n = atoi(carray); 
   // myservo1.writeMicroseconds(n); // for microseconds
    myservo1.write(n); //for degees 0-180
    readString="";
  }
}

When i send a character for ex: ‘a’ i one to control servo 1, when i send character b, i want to control servo 2.

The output need to be like this:

Which servo you want to use(a , b)
a
11
80
90
110

This is my code for one servo

  myservo1.attach(3);  // attaches the servo on pin 9 to the servo object
  myservo2.attach(5);
  myservo3.attach(6);
  myservo4.attach(9);
  myservo5.attach(10);
  myservo6.attach(11);

So, which of the 6 servos is a, and which is b? What controls the rest of the servos?

while (Serial.available()) {
    delay(1); 
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      readString += c; //makes the string readString
    } 
}

Under what circumstances does the delay(1) statement get executed? Only when there is one or more bytes of data in the serial buffer.

So, after the delay(), during which more data might have arrived, but none can have gone away, why is it necessary to check for data in the buffer again?

Why are you waiting to read the data, anyway?

You are expecting a single numeric value to control the servo's position. You need to change that expectation to one of two scenarios.

First, the input can be a numeric value OR a letter. If it is a letter, that defines which servo to move later, but causes no movement. If it is a numeric value, that defines the new servo position. Move the specified servo, if one has been specified (by letter), to the new position.

Or, the input can be a letter, a delimiter, and a number value. The delimiter is optional if there will never be more than 26 servos. Extract the servo to move letter, and convert the rest to a value.

    char servoLetter = readString[0];
    readString[0] = '0';
    char carray[6]; //converting string to number
    readString.toCharArray(carray, sizeof(carray));
    n = atoi(carray);

Then, use a switch statement with cases for each letter/servo to move the correct servo.

I need to use 6 servos, but for understanding a problem i only activated two off them. a is servo1, b is servo 2.