Sayzer,

Your PIC's math is working great!

Change the last part of your code to this:

FOR XA=0 to 150
XB=XB-2
IF XF = XA THEN
XF = XB
GOTO HERE
ENDIF
NEXT XA

HERE:
LCDOUT $FE,1,”Temp:”,#XF

Your code is actually changing the value of XF twice in the region you thought was flawed (e.g., for 46464, XB = 149. Your If Then sets XF = 149. Your loop continues and finds XF = 149. 303 - (149+1)*2 = 3 ... the math is correct)

Paul Borgmeier
Salt Lake City, Utah
USA