I need help for the direction of rotation of my servo

Hello, I request your help because I am on a project of door home automation and a problem opposes me.
I would like that at first when I press the button opening in my application servomotor “S” (lock) opens then after 1sec the servomotor “P” (door) opens in turn. Then when I press closure is at first the servomotor “P” which turns and then the servomotor “S” which turns. Yet it is not the case but the opposite that occurs!! You could help me please? This joins the code:"#include <SoftwareSerial.h> // TX RX software library for bluetooth

#include <Servo.h> // servo library
Servo myservo; // servo name
Servo myservob; // servo name

int bluetoothTx = 10; // bluetooth tx to 10 pin
int bluetoothRx = 11; // bluetooth rx to 11 pin

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
myservo.attach(9); // attach servo signal wire to pin 9
myservob.attach(3); // attach servo signal wire to pin 9

//Setup usb serial connection to computer
Serial.begin(9600);

//Setup Bluetooth serial connection to android
bluetooth.begin(9600);
}

void loop()
{
//Read from bluetooth and write to usb serial
if(bluetooth.available()> 0 ) // receive number from bluetooth
{
int servopos = bluetooth.read(); // save the received number to servopos
Serial.println(servopos); // serial print servopos current number received from bluetooth
myservo.write(servopos); // roate the servo the angle received from the android app
delay(1000);
myservob.write(servopos); // roate the servo the angle received from the android app

}

}
"

I would like that at first when I press the button opening in my application servomotor "S" (lock) opens then after 1sec the servomotor "P" (door) opens in turn.

There is nothing in your code that relates an instance of the Servo class to the names "S" and "P".

Try again.

    Serial.println(servopos); // serial print servopos current number received from bluetooth

What do you see in the Serial monitor ? You will need to make decisions based on what is received.

Can I suggest that you give your servos more meaningful names to make the code easier to understand.

PaulS:
There is nothing in your code that relates an instance of the Servo class to the names “S” and “P”.

Try again.

Thanks for your answer “S” is “myservo” and “P” is “myservob”

UKHeliBob:    Serial.println(servopos); // serial print servopos current number received from bluetooth

What do you see in the Serial monitor ? You will need to make decisions based on what is received.

Can I suggest that you give your servos more meaningful names to make the code easier to understand.

Thanks for your answer ! I had not thought of looking in the serial monitor I'm going to look ! And yes I'm going to rename my servo it will be easier.

I had not thought of looking in the serial monitor

Oh dear.

What do you expect to see ? What do you actually see ?

Thanks for your answer "S" is "myservo" and "P" is "myservob"

Why? There is NOTHING magic about the stupid name myservo. Name the instance "S", so you KNOW which servo it is supposed to be. Name the other instance "P".

Make sure that you know which servo is connected to which pin, since the comments are useless.