Works great now!
Code:
INTERNALTEMP:
OWOut DQI,1,[$CC,$44] 'REQUEST FOR INT TEMP AD CONVERSION
PAUSE 750 'WAIT FOR CONVERSION TO COMPLETE
OWOut DQI,1,[$CC,$BE] 'REQUEST XMIT OF TEMP DATA
OWIn DQI,0,[INTTEMP.LOWBYTE,INTTEMP.HIGHBYTE] 'REC TEMP DATA
IF INTTEMP.HIGHBYTE = $00 THEN INTTEMPSIGN = 43 'CHECK HIGHBYTE SET SIGN +
IF INTTEMP.HIGHBYTE = $FF THEN INTTEMPSIGN = 45 'CHECK HIGHBYTE SET SIGN -
IF INTTEMP.HIGHBYTE = $FF THEN INTTEMP.LOWBYTE = ($FF - INTTEMP.LOWBYTE) 'INVERT LOWBYTE FOR NEG
INTTEMP.LOWBYTE = INTTEMP.LOWBYTE / 2 'DIV BY 2 FOR DEGREES C
INTC_TENS = INTTEMP.LOWBYTE / 10 'CALC TENS DIGIT
INTC_ONES = INTTEMP.LOWBYTE - (INTC_TENS * 10) 'CALC ONES DIGIT
INTTX(1) = $30 + INTC_TENS 'CONVERT TO ASCII
INTTX(2) = $30 + INTC_ONES 'CONVERT TO ASCII
GOTO INTERNALTEMP
end
Bookmarks