I searched all the files in the project and I never used "Option Base" at all.
Is this an issue with the compiler or do I have a programming bug somewhere?
-Tony
Code: Select all
Private Sub RangerTask()
Dim Range_Cmd(1 to 2) as byte
Dim Readings(1 to 3) as byte
'this does not work:
'Dim Range_Cmd(2) as byte
'Dim Readings(3) as byte
Dim Result as Integer
Dim Reg as byte
Do
Range_Cmd(1) = CmdReg
Range_Cmd(2) = RangeCmd
Result = I2CCmd(1,SRF08_ADDRESS, 2, Range_Cmd,0,0)
Call Delay(0.070)' 70mS wait for ranging to complete; 65ms min
Reg = LdrReg
Result = I2CCmd(1,SRF08_ADDRESS,1,Reg,3,Readings)
'Bytes: Light, Range_Hi, Range_Lo
Light = Readings(1)
Range = Cint(MakeWord(Readings(3), Readings(2)))
Loop While (RangerEnable)
End Sub