Show Posts
Pages: [1]
1  Products / Arduino Due / HMC5883L library is incorrect while it work with Arduino Due on: January 10, 2013, 08:53:12 am

I got the HMC5883L library from following web page.
http://bildr.org/2012/02/hmc5883l_arduino/

I've tested it with Arduino Pro mini, it is OK.
But the result on Due is incorrect.
It seems not consider the 2's complement.

the attached image shows Due not consider 2's complement.
and following data come from I2C sniffer.
Code:
-------------------- Start to Monitor I2C / SMBus / PMBus Procotol --------------------
-------------------- All data will be monitored and display on screen -----------------
 [S] 3C 02 00 [P]
 [S] 3C 03 [P]
 [S] 3D 00 F3 01 52 FF 82# [P]

for 2's complement, 0xFF82 should be -126 not 65410.

Could somebody tell me how to fix this issue?
Thanks!

GT
Pages: [1]