Problems with Compass Parallax #29323 (HMC6352)
mohamedelnono
Posts: 6
i have a problem in programming the compass any one help me please
i used pic micro
i use proton basic for programming
i used pic micro
i use proton basic for programming
Comments
I2C_LSB = I2C_DATA.BIT0 ' Store the status of the LSB
I2C_DATA = I2C_DATA / 2
SHIFTOUT SDA, SCL, MSBFIRST, [I2C_DATA\7] ' Write out the first 7 bits, MSB first
IF I2C_LSB THEN INPUT SDA ELSE LOW SDA ' Write the 8th bit
i have question in the if condition
what does it mean in this case if IF I2C_LSB Then if what ?
This group of statements sends an 8-bit value and leaves the SDA line in an appropriate state for the I2C bus, namely either high impedance or logic low.
There are descriptions of how the I2C bus works in the Wikipedia and in pretty much any datasheet for an I2C device like the compass.