i find the problem : i need to put register a the end off readbyte
Register Function
0 Software Revision Number
1 Compass Bearing as a byte, i.e. 0-255 for a full circle
2,3 Compass Bearing as a word, i.e. 0-3599 for a full circle, representing 0-359.9 degrees.
4,5 Internal Test - Sensor1 difference signal - 16 bit signed word
6,7 Internal Test - Sensor2 difference signal - 16 bit signed word
8,9 Internal Test - Calibration value 1 - 16 bit signed word
10,11 Internal Test - Calibration value 2 - 16 bit signed word
12 Unused - Read as Zero
13 Unused - Read as Zero
14 Calibration Done Flag - Zero in calibrate mode when un-calibrated, 255 otherwise - unused in Rev 7 software & CMPS03
15 Calibrate Command - Write 255 to enter calibrate mode, write zero to exit. See text.
Code: Select all
sw_revision = 0
sw_revision = I2C.ReadByte(0)
I2C.Acknowledge
ee_byte = 0
ee_byte = I2C.ReadByte(1)
I2C.Acknowledge
ee_high = 0
ee_high = I2C.ReadByte(???????????)
I2C.Acknowledge
How can i put register 2 at the end off ee_high = I2C.ReadByte(?????)