MPU6050/9250 I2C and SPI interface. Sensor fusion using a complementary filter yields sensor Euler angles and is implemented in five different languages.
You did a good job ;) but looks like something wrong with madgwickFilter in 9DOF/main.py
mx = mpu.my and my = - mpu.mx
Please add notes to your code - i thought it was mistake
// Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of the magnetometer;
// the magnetometer z-axis (+ down) is opposite to z-axis (+ up) of accelerometer and gyro!
You can also improve your code when read raw data:
replace
for ii in range(7):
rawData.append(self.bus.read_byte_data(self.MPU9250_ADDRESS, self.EXT_SENS_DATA_00 + ii))
by "rawData = self.bus.read_i2c_block_data(self.MPU9250_ADDRESS, self.ACCEL_OUT, 14)"
and add try/except block - sometime self.bus.read return error while try to read raw data
Hi Mark!
You did a good job ;) but looks like something wrong with madgwickFilter in 9DOF/main.py mx = mpu.my and my = - mpu.mx Please add notes to your code - i thought it was mistake // Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of the magnetometer;
// the magnetometer z-axis (+ down) is opposite to z-axis (+ up) of accelerometer and gyro!
You can also improve your code when read raw data: