The project doesn't work. Please, help me!!

Hello,
I made a project that consists in 4 servos, 1 IR sensor (coin detector), 1 bluetooth module HC-05.

The project is a vending machine made with arduino which, when a coin is throwed and the buttons in the mobile are pressed, the motor that corresponds to the button pressed moves (there's also an LCD screen).

The problem is that project doesn't work. I think the problem is in the code, in the part of the bluetooth. I use Roboremo for sending A, B, C or D to the bluetooth module.

Can you help me please fixing the code? Thanks

#include <LiquidCrystal.h> 

#include <SoftwareSerial.h>

#include <Servo.h>


LiquidCrystal lcd(27, 26, 25, 24, 23, 22);

Servo myServo1, myServo2, myServo3, myServo4;

#define coinDetector 9


 
// the pins for the HC-05:

int TxD = 10; 
int RxD = 11;
SoftwareSerial bluetooth(TxD, RxD);

int servoposition;

int servopos;

int new1;



void setup() {

  int pos=0;

  myServo1.write(0);

  myServo2.write(0);

  myServo3.write(0);

  myServo4.write(0);

  myServo1.attach(1);

  myServo2.attach(3);

  myServo3.attach(0);

  myServo4.attach(2);

 

  Serial.begin(9600); 

  bluetooth.begin(9600);

 

  lcd.begin(16,2); 

  pinMode(coinDetector, INPUT);

}


void loop() {

 

  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print("Insert a coin!"); // just messages for the LCD, no problem

 

  while (true) {

    if (digitalRead(coinDetector) ==  LOW) { // if the coindetector detect a coin, continue

      break;

    }

  }

 

  delay(10);

  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print("Select your item"); //another messages

  lcd.setCursor(0, 1);

  lcd.print(" 1, 2, 3 or 4?"); //more messages

 

 

 

// this is the part I'm not sure if it's coded properly
  if (bluetooth.available()){

    String value = bluetooth.readString();

    servoposition = value.toInt();

    int servopos = bluetooth.read();



  Serial.println(servopos);

  myServo1.write(servopos);

  myServo2.write(servopos);      

  myServo3.write(servopos);     

  myServo4.write(servopos);


//this I'm not sure too:
  if (value.toInt() == "A"){

    Serial.println(servoposition);

    myServo1.write(360);

  }



  if (value.toInt() == "B"){

                      

    Serial.println(servoposition);

    myServo2.write(360);

   }



  if (value.toInt() == "C"){

               

    Serial.println(servoposition);

    myServo3.write(360);

  }



  if (value.toInt() == "D"){

         

    Serial.println(servoposition);

     myServo4.write(360);

  }

}




  servopos++;

  delay(30);

  Serial.println(servopos);

  myServo1.write(servopos);

  myServo2.write(servopos);

  myServo3.write(servopos);

  myServo4.write(servopos);



 




  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print("Delivering..."); //the final message

 

 

 

  lcd.clear(); // Clears the display

  lcd.setCursor(0, 0);

  lcd.print("Item delivered!"); //ups!, this is the really final

  delay(2000);

}

Please help me, all the libraries are uploaded. What's the problem?

  myServo1.attach(1);

  myServo2.attach(3);

  myServo3.attach(0);

  myServo4.attach(2);

 

  Serial.begin(9600);

You can't attach servos to the hardware serial pins and still expect to use them to do serial output.

"Doesn't work" gives us no useful information from which to help you.

Tell us in detail what happens when you run the program and what you want it to do that is different.

You mention servos, an IR sensor and Bluetooth. I presume you have tried a short program to learn separately how to use each of them

...R

And you cannot compare integers to strings.

if (value.toInt() == "A"){

Should be

if (value.toInt() == ‘A’){

Talk us through how you think this should work

if (bluetooth.available()){

    String value = bluetooth.readString();

    servoposition = value.toInt();

    int servopos = bluetooth.read();

Thank you all. What exactly I want to do is when the coin detector detects something (a coin), I can press the buttons in my mobile which send a message (A, B, C, D)to the Bluetooth module. If it recieves 'A', the servo 1 moves, when it recieves 'B', the seevo 2 moves, and so on.

However, what actually the project does is when I upload the code, the servos start to move, first one of them, then other...

Thank you Whatts that, I'm going to change it
OK PaulS, but what should I put instead?
And AWOL, the code that you put, is equal to the original, isn't it?