NORM!
This works great!
I tested it with my circuit and it works perfect down to at least -20C (-4F) which is as cold as my freezer goes.
So that should cover the full range of temperature now.
I really appreciate the help from all of you.
I've pondered the problem several times over the last few years but never came up with code that worked over the full range of positive and negative temps.
This is very cool
THANKS! THANKS! THANKS!
Oh, and this is the first time that I've played with "DIV32". Very handy that is....Code:subC_TO_F: F = C * 9 F = DIV32 5 IF C_sign = 1 THEN 'if the sign bit is "1" is minus C IF F > 3200 THEN F = F - 3200 lcdout $fe,$2," C = -",DEC C/100,".",DEC2 C,$fe,$c0," F = -",DEC F/100,".",DEC2 F," " ELSE F = 3200 - F lcdout $fe,$2," C = -",DEC C/100,".",DEC2 C,$fe,$c0," F = ",DEC F/100,".",DEC2 F," " ENDIF ELSE F = F + 3200 lcdout $fe,$2," C = ",DEC C/100,".",DEC2 C,$fe,$c0," F = ",DEC F/100,".",DEC2 F," " ENDIF pause 200 RETURN






Bookmarks