Problem getting data from MPU6050 connected with HC-5

Hello Friends,
I am Daryl, a student currently doing a project for internship. The project i made needed me to read a raw data from a MPU6050 gyroscope that powered by an Arduino mini pro, through a bluetooth module hc-05(master). To get the data, i use another hc-05(slave) bluetooth module and an Arduino mega and connect them to my laptop. The idea is to send the data received from MPU6050 through bluetooth modules. The problem is i do not know what code should i write for each of this arduino to send the data. I have read at watch some tutorials about sending data through bluetooth module, but none of them sending gyroscope data.

Could you guys please help me with the code?

thankyou

Here is the code i'm using to get the MPU6050 raw data:

#include<Wire.h>
const int MPU_addr=0x68;  // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
  Wire.begin();
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
  Wire.endTransmission(true);
  Serial.begin(9600);
}
void loop(){
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  AcX=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)     
  AcY=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  AcZ=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GyX=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GyY=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GyZ=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  char text[40];
  sprintf(text, "%d,%d,%d,%d,%d,%d,%d\n",AcX, AcY, AcZ, Tmp, GyX, GyY, GyZ);

  Serial.println(text);
  delay(10);
}

A schematic is definitely in order. If the bluetooth modules are properly configured, paired, and connected, they simply replace wires between the appropriate TX and RX pins on the respective Arduinos.

I am still kind of new in Arduino. So do i need to put Serial.write on each of the Wire.read? and is it possible to send all of these 7 data (AcX,AcY,..) at the same time?

So do i need to put Serial.write on each of the Wire.read?

Yes.

and is it possible to send all of these 7 data (AcX,AcY,..) at the same time?

Yes, but it won't be any faster.

Buongiorno,
scusate se mi intrometto ma anche io sono alle prese con un problema simile. Come posso conoscere l'indirizzo del MPU? Grazie

gollum:
Buongiorno,
scusate se mi intrometto ma anche io sono alle prese con un problema simile. Come posso conoscere l'indirizzo del MPU? Grazie

Google translated that as:
Good morning,
sorry if I'm intruding but I'm also grappling with a similar problem. How can I find out the address of the MPU? Thank you

Run the I2C scanner sketch. It will report the address of any properly connected and functioning I2C device.