Hi and welcome Kevin,
I think the problem is that you are using the old syntax for I2C. You should download the latest draft version version of the updated manual from the thread:
syntax-manual-f501/new-manual-t9180.html.
Also in future posts it be helpful if you included additional information, such as which version of the compiler you were using and was it that it did not compile or did it not give you the results you expected...
My guess is that the proper new syntax would probably look like:
Code:
SDA Con P8 ' Define Data pin
SCL Con P9 ' Define Clk pin
Compass Con 0xC0 ' Compass I2C Address
CmdReg Con 0 ' Sonar Command register
BearingReg Con 2 ' Sonar 1st Range register
Bearing Var Word ' 16 bit variable for Bearing
Main
i2cout SDA, SCL, Compass, [BearingReg]
i2cin SDA, SCL, Compass, [Bearing.HighByte, Bearing.LowByte]
Serout S_OUT, i9600, ["Compass Bearing ", DEC Bearing/10, " Degrees", 13] ' Use terminal window
goto main
Kurt