Hello everybody! I'm really new in Arduino. I have a project going on right now about the MPU6050 gyroscope and accelerometer sensor. I was trying to gather the data and plot in PLX-DAQ in real time but for some reason the PLX-DAQ is not showing any values in the table. Also, the values that's coming from the sensor is reading in Display direct debug window but nothing is showing up in the excel spreadsheet. I just want the raw data from coordinate x, y, z displaying and graphing realtime in excel spreadsheet. Below is my program and some screens shots. It would be a very big help if someone can help me with this one. Thank you everybody.
#include <Wire.h>
long gyroX, gyroY, gyroZ;
float rotX, rotY, rotZ;
void setup() {
Serial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,X=,Y=,Z=");
Wire.begin();
setupMPU();
Serial.println("RESETTIMER");
}
void loop() {
recordGyroRegisters();
Serial.print("Gyro (deg/sec)");
Serial.print(" X=");
Serial.print(rotX);
Serial.print(" Y=");
Serial.print(rotY);
Serial.print(" Z=");
Serial.println(rotZ);
delay(100);
}
void setupMPU(){
Wire.beginTransmission(0b1101000); //This is the I2C address of the MPU (b1101000/b1101001 for AC0 low/high datasheet sec. 9.2)
Wire.write(0x6B); //Accessing the register 6B - Power Management (Sec. 4.28)
Wire.write(0b00000000); //Setting SLEEP register to 0. (Required; see Note on p. 9)
Wire.endTransmission();
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x1B); //Accessing the register 1B - Gyroscope Configuration (Sec. 4.4)
Wire.write(0x00000000); //Setting the gyro to full scale +/- 250deg./s
Wire.endTransmission();
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x1C); //Accessing the register 1C - Acccelerometer Configuration (Sec. 4.5)
Wire.write(0b00000000); //Setting the accel to +/- 2g
Wire.endTransmission();
}
void recordGyroRegisters() {
Wire.beginTransmission(0b1101000); //I2C address of the MPU
Wire.write(0x43); //Starting register for Gyro Readings
Wire.endTransmission();
Wire.requestFrom(0b1101000,6); //Request Gyro Registers (43 - 48)
while(Wire.available() < 6);
gyroX = Wire.read()<<8|Wire.read(); //Store first two bytes into accelX
gyroY = Wire.read()<<8|Wire.read(); //Store middle two bytes into accelY
gyroZ = Wire.read()<<8|Wire.read(); //Store last two bytes into accelZ
processGyroData();
}
void processGyroData() {
rotX = gyroX / 131.0;
rotY = gyroY / 131.0;
rotZ = gyroZ / 131.0;
}

