Slow communication speed

I need some help me improve my program so that i could communicate with my bluetooth car faster?
I think there is a problem with my serial buffer, it runs very slow...

int motor1clock=7,motor1clockc=8,pwm1=3,pwm2=9,motor2clock=10,motor2clocko=16;
String inputString="";

void setup() {
pinMode(motor1clock,OUTPUT);
pinMode(motor1clockc,OUTPUT);
pinMode(pwm1,OUTPUT);
pinMode(motor2clocko,OUTPUT);
pinMode(motor2clock,OUTPUT);
pinMode(pwm2,OUTPUT);
Serial1.begin(115200);
}
void Forwards(int spee){
analogWrite(pwm2,spee);
analogWrite(pwm1,spee);
digitalWrite(motor1clock,LOW);
digitalWrite(motor1clockc,HIGH);
digitalWrite(motor2clocko,HIGH);
digitalWrite(motor2clock,LOW);
}
void Backwards(int spee){
analogWrite(pwm2,spee);
analogWrite(pwm1,spee);
digitalWrite(motor1clock,HIGH);
digitalWrite(motor1clockc,LOW);
digitalWrite(motor2clocko,LOW);
digitalWrite(motor2clock,HIGH);

}
void Steer_Left(int spee){
analogWrite(pwm2,spee-20);
analogWrite(pwm1,spee);
digitalWrite(motor1clock,LOW);
digitalWrite(motor1clockc,HIGH);
digitalWrite(motor2clocko,LOW);
digitalWrite(motor2clock,HIGH);
}
void Steer_Right(int spee){
analogWrite(pwm2,spee);
analogWrite(pwm1,spee-20);
digitalWrite(motor1clock,HIGH);
digitalWrite(motor1clockc,LOW);
digitalWrite(motor2clocko,HIGH);
digitalWrite(motor2clock,LOW);
  }
void loop() {
if(Serial1.available()>0){
String str= Serial1.readString();  
while (Serial1.available() > 0)  
{ Serial1.readString(); }
char inChar[20],c; 
str.toCharArray(inChar,20);
int num=atoi(&inChar[1]);
c=inChar[0];
if(c=='A')
{
Forwards(num);
}


if(c=='B')
{
Backwards(num);
}

if(c=='C')
{
 Steer_Left(num);
}

if(c=='D')
{
Steer_Right(num);
}
if(c=='S')
{
digitalWrite(motor1clock,LOW);
digitalWrite(motor1clockc,LOW);
digitalWrite(motor2clocko,LOW);
digitalWrite(motor2clock,LOW);
}
inputString ="";
}

}

I would get rid of all use of Strings and String processing. It is very slow and often causes memory problems.

dany17:
I need some help me improve my program so that i could communicate with my bluetooth car faster?

Don't use Serial1.readString(); because it is a blocking function.

Have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data.

...R

Robin2:
Don't use Serial1.readString(); because it is a blocking function.

Have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data.

...R

I will try that tomorrow, thanks for the response!