This is how my setup looks like:
The first thing that needs to be done is to deactivate the on-board MAG.
This is done by carefully cutting the bridge between the pads as seen in the picture below (red arrows):
The next step is to modify the MultiWii firmware.
To tell MultiWii what board we have we need to activate this line in config.h:
Code: Select all
#define CRIUS_AIO_PRO
Next we need to look in config.h and search for MAG type entries. Here we need to active the appropriate device. In my case the HMC5883.
For example (config.h):
Code: Select all
/* I2C magnetometer */
//#define HMC5843
#define HMC5883
//#define AK8975
//#define MAG3110
Then we need to tell the MultiWii firmware that the on-board MAG is no longer active.
Go to the def.h and look for "CRIUS_AIO_PRO" and then for "MPU6050_I2C_AUX_MASTER".
This needs to be deactivated like so (def.h):
Code: Select all
// #define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
Be aware that you might also have to correct the 3 axis for your MAG in this line (def.h):
Code: Select all
#define MAG_ORIENTATION(X, Y, Z) {imu.magADC[ROLL] = X; imu.magADC[PITCH] = -Y; imu.magADC[YAW] = Z;}
You are now all set to use the external magnetometer.
Leo