I am chasing some bugs in my code that i'm at an absolute loss to explain.. Consider the following code. Device is a 18F26K40.
Code: Select all
Dim Array(10)
Dim XBUS_Throt as Array(6).AsWord
Sub data_print()
LCD.WriteAt(1,12,DecToStr(XBUS_Throt,4," ")) //Print on line 1
LCD.WriteAt(2,12,DecToStr(XBUS_Throt,4," ")) //Print again on line 2
if xbus_throt>1050 then //Check if above set position
time_enable=true
end if
end sub
Start:
// main code here that loads a 12 bit number into Array (6) and Array(7)
Data_print()
goto Start
More interestingly though is that the second line will print correctly when the IF-End-if check condition is true, IE if Xbus_throt is greater than 1050..
I am at an absolute loss to explain how this could be???
If i remove the IF End-if block then the code runs as it should and prints correctly to both lines.
Any advice appreciated..
Cheers
Lee