Robot not working with bluetooth

hi
this is chirayu and
my robot is not working with blutooth
please advice
code given below

#include <AFMotor.h>

AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);

char bt='S';
void setup()
{
  Serial.begin(38400);
 
  motor1.setSpeed(255);
  motor2.setSpeed(255);
  motor3.setSpeed(255);
  motor4.setSpeed(255);
  Stop();
}


void loop() {
 
bt=Serial.read();

if(bt=='F')
{
 forward(); 
}

if(bt=='B')
{
 backward(); 
}

if(bt=='L')
{
 left(); 
}

if(bt=='R')
{
 right(); 
}

if(bt=='S')
{
 Stop(); 
}

}
void forward()
{
     motor1.run(FORWARD);
  motor2.run(FORWARD);
  motor3.run(FORWARD);
  motor4.run(FORWARD);
}

void backward()
{
     motor1.run(BACKWARD);
  motor2.run(BACKWARD);
  motor3.run(BACKWARD);
  motor4.run(BACKWARD);
}
void left()
{
  motor1.run(FORWARD);
  motor2.run(FORWARD);
  motor3.run(BACKWARD);
  motor4.run(BACKWARD);
}
void right()
{
  motor1.run(BACKWARD);
  motor2.run(BACKWARD);
  motor3.run(FORWARD);
  motor4.run(FORWARD);
}
void Stop()
{
  motor1.run(RELEASE);
  motor2.run(RELEASE);
  motor3.run(RELEASE);
  motor4.run(RELEASE);
}
``
`
Thank you

So are you using your phone ?
To controll

Was it working before, when you were controlling it via USB?
What steps have you taken to debug your problem?

Motors are working fine but after attaching bluetooth code .
Bluetooth is not giving commands
to uno .

Yes

What is attached to pins 0 and 1?

bluetooth

RXD - 1

TXD - 0

So you've disconnected the the serial-USB device on the Uno?

yes

That must make debugging and uploading new software awkward.

Not clear to me .Please explain

If you disconnected the device that converts the USB interface (16U2 or CH340 or whatever) to the serial interface on pins zero and one of the 328,it must make downloading new code to the 328 difficult.

Can you please suggest the modification in our code

I'd be inclined to drop the BT serial rate to 9600 (or lower), and put it on a software serial connection, and leave the hardware serial connection for debugging.

Don't forget to reconnect the USB/serial converter

Ok ,
But i have a doubt That after connecting USB for uploading .
And after uploading i have to disconnect USB as it is controlled by bluetooth.
So i have to disconnect USB ?