http://mbed.org/users/JimCarver/code/MAG3110/#1da3fe7b3510