sending data of MPU6050 & Voice module by HC-05 BT for 2 softserial parallelly

I needed to send MPU6050's accelerometer and gyroscope data and voice recognition module's voice command status flag through the HC-05 Bluetooth module to receiver Bluetooth and Arduino. But because both Bluetooth HC-05 and Electrohouse voice recognition module use software serials, and not more than one software serial can function at a time, I had to search for a solution. I found that one solution is to alternate the serials. But my project is a wireless head mouse project. So, to decrease the mouse cursor lag, I need HC-05 and voice recognition module V3.1 to work parallelly using Soft pins since I cannot let the data wait at one end. Otherwise the cursor would show lagging behaviour. How can I solve this problem?

Put Bluetooth on hardware serial? (after you have uploaded the revised programme).

Nick_Pyner:
Put Bluetooth on hardware serial? (after you have uploaded the revised programme).

I don't know why but I could never get My HC-05 modules to work on hardware serial. I followed 6 or so tutorials on YouTube. I don't know why that those didn't work.

The connection was
HC-05 to Arduino
RX->TX via 1k ohm and another branch used as voltage divider from HC to 2k ohm to ground.
TX->RX
GND->GND,
VCC->VCC,
EN->VCC

I don't know why but I could never get My HC-05 modules to work on hardware serial. I followed 6 or so tutorials on YouTube. I don't know why that those didn't work.

It's not complicated.

Leave the HC05 unconnected, and get your program working correctly with input from the Serial monitor. Then after the final working program is uploaded, connect the HC05 to the hardware serial pins. Cross connected with TX>RX and RX>TX as you indicate.

EN->VCC

EN should be left unconnected for data mode.

cattledog:
EN should be left unconnected for data mode.

Probably the only mistake!
And fatal with software serial too, so I suppose this is one of those stupid things that will only happen once.

Probably the only mistake!
And fatal with software serial too, so I suppose this is one of those stupid things that will only happen once.

Tried your suggestion. I have paired my Bluetooth modules from another tutorial online. They can now communicate with each other indicated by the blinking. But the problem is the receiver side arduino doesn't receive anything. The RX, TX light of Arduino Micros don't light up on either side. Only both TX lights on the Arduino of the two sides light up when I open up their respective serial monitors.
Code below:

sender and receiver code respectively:

byte b=0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  
  Serial.write(b);
  if(!Serial.write(b))Serial.println("TX Error");
  else Serial.println(b);
  ++b;

  delay(100);  
}
byte b =0;

void setup()
{
  //Wire.begin();
  Serial.begin(9600);
}

void loop()
{     
      
      if(Serial.available()){
      byte b = Serial.read();
      Serial.println(b);
      }
      else Serial.println("Nothing received");
    //Mouse.move(Gyro_data.gyro_X, Gyro_data.gyro_Y);
    delay(100);
}

Receiver serial monitor shows nothing received

I have no idea if your ++b; is kosher, but humour me with b++;
Also, instead of
Serial.println(b);
in the second code, try
Serial.write

God knows who the other tutorial is by, but I think the gold standard is on the Martyn Currey website. He has code for Arduino<>Arduino but it will be on software serial and using keyboard. The principle will be the same.

I have run your code without Bluetooth, but just connecting the TX to RX of two Arduino's after the code is loaded. Your output is confusing because of what you write and print and the duplication of output with

Serial.write(b);
  if(!Serial.write(b))

There are issues with the synchronization and the use of delay().

Remove the delay from the receiver.