I'm building a quadcopter with a mpu6050. I'm able to get the values from the mpu6050 from the gyro sketch.
In the sketch is writen:
Serial.print(F("accel x,y,z: "));
Serial.print(accel_t_gyro.value.x_accel, DEC);
Serial.print(F(", "));
Serial.print(accel_t_gyro.value.y_accel, DEC);
Serial.print(F(", "));
Serial.print(accel_t_gyro.value.z_accel, DEC);
Serial.println(F(""));
I want to use the printed value in a variable but when i use 'accel_t_gyro.value.x_accel' in a variable I get this error:
request for member 'value' in 'accel_t_gyro', which is of non-class type 'int'
How can I fix this?
Gyro.ino (31.6 KB)