http://www.hobbyking.com/hobbyking/store/__31138__Multiwii_and_Megapirate_AIO_Flight_Controller_w_FTDI_ATmega_2560_V2_0.html
Piled with this GPS+MAG combo from Banggood.
http://www.banggood.com/CRIUS-NEO-GPS-MAG-V2-NEO-7M-Module-With-Compass-p-951898.html
GPS is working fine, but I can't get the I2C compass to work.
This is what I have done:
Taken out the onboard mag.
config.h
Code: Select all
/* I2C magnetometer */
//#define HMC5843
#define HMC5883
//#define AK8975
//#define MAG3110
I believe I have selected the right mag as the Banggood mag is an "L883"
def.h
Code: Select all
#if defined(CRIUS_AIO_PRO_V1)
#define MPU6050
#define HMC5883
#define MS561101BA
#define ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = -X; imu.accADC[PITCH] = -Y; imu.accADC[YAW] = Z;}
#define GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = Y; imu.gyroADC[PITCH] = -X; imu.gyroADC[YAW] = -Z;}
#define MAG_ORIENTATION(X, Y, Z) {imu.magADC[ROLL] = X; imu.magADC[PITCH] = Y; imu.magADC[YAW] = -Z;}
//#define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
Undefined the last line.
The SDA from the I2C mag is on the SDA of the I2C port on the flight controller, SCL to SCL.
I have noticed that solely rotating the flight controller gives random readings in the GUI, and solely rotating the external mag also gives random readings in the GUI.
Any ideas would be appreciated.