You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a Teensy 4.0 with normal and working connections. The unit seems to be working fine and reporting data with the MPU6050_raw example.
I'm looking at the value for getAccelerationZ and it's reporting 16072 (unit z is pointing up). If I smack the unit i can get a max of just over 32000--This makes sense since the datatype is an int16.
However, how do I get g force? If 16,384 is 1 g, then this unit can only report up to 2 g's (accel/16384).
//accelgyro.CalibrateGyro(); // Fine tune after setting offsets with less Loops.
//accelgyro.CalibrateAccel(); // Fine tune after setting offsets with less Loops.
}
Thanks for the library, it's very complete.
I'm using a Teensy 4.0 with normal and working connections. The unit seems to be working fine and reporting data with the MPU6050_raw example.
I'm looking at the value for getAccelerationZ and it's reporting 16072 (unit z is pointing up). If I smack the unit i can get a max of just over 32000--This makes sense since the datatype is an int16.
However, how do I get g force? If 16,384 is 1 g, then this unit can only report up to 2 g's (accel/16384).
Here's my code.
#include "I2Cdev.h"
#include "MPU6050.h"
#include "Wire.h"
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
elapsedMillis Timer;
void setup() {
Wire.begin();
Serial.begin(38400);
accelgyro.initialize();
accelgyro.setFullScaleGyroRange((MPU6050_IMU::MPU6050_GYRO_FS_1000));
accelgyro.setFullScaleAccelRange((MPU6050_IMU::MPU6050_ACCEL_FS_16));
//accelgyro.CalibrateGyro(); // Fine tune after setting offsets with less Loops.
//accelgyro.CalibrateAccel(); // Fine tune after setting offsets with less Loops.
}
void loop() {
Serial.print(accelgyro.getAccelerationX());
Serial.print(",");
Serial.print(accelgyro.getAccelerationY());
Serial.print(",");
Serial.println(accelgyro.getAccelerationZ());
delay(10);
}
Thoughs?
The text was updated successfully, but these errors were encountered: