Play around with the xtrinsic sensors package available through Element14. Includes the MAG3110,MMA8491Q and MPL3115.

Dependencies:   MAG3110 MMA8491 MMA8491Q MPL3115 MPL3115A2 mbed