http://mbed.org/users/SomeRandomBloke/code/MAG3110/#f3abe901c33a