Arduino bluetooth HC-05 servo control I am using HC-05 Bluetooth module to control two servos. I use Bluetooth terminal in my android phone to control them. 

Problem is that myServo1 is moving like I want but I can't control myServo2. Code is reading the variable a but it can't read variable b. 

#include &lt;SoftwareSerial.h&gt;
#include &lt;Servo.h&gt;
Servo myServo1;
Servo myServo2;
int servo;
SoftwareSerial BT(2, 3); 
void setup()  
{
myServo1.attach(11);
myServo2.attach(10);
servo = 90;


Serial.begin(9600);
BT.begin(9600);
}
char a; 
char b;
void loop() 
{
 if (BT.available())
{
a=(BT.read());
b = (BT.read());
if (a=='1')
{
  myServo1.write(180);
  delay(50);


}
if (a=='2')
{
  myServo1.write(-180);
  delay(50);


 }
  if (b=='3')
{
  myServo2.write(90);
  delay(50);


}
  if (b=='4')
{
  myServo2.write(-90);
  delay(50);


}
}
}


Where is the problem?
When using

if(BT.available())


that's doing the same as

if(BT.available() &gt; 0)


But then you are reading 2 bytes, though you cannot be sure, that there are 2 bytes to read. The data is transmitted serially, so even when you send it on your phone in one bunch, it does not get transmitted as bunch.

Try to use

if(BT.available() &gt;= 2)


Also makes sure, that nothing else gets send over serial besides the numbers (often there is a line ending send implicitly depending on the used app).