Hello,
I am using the Dallas 18S20 to measure temperature. My code is working and I can display the decimal temp on the LCD screen.
My problem is:
The 18S20 provides the temp in HEX (example. $31), I convert that to decimal 49. I then divide 49 by 2 and obtain the temprature of 29degs C.
I need to transmit the "2" and "9" in ASCII. How do I strip the "2" and "9" from the decimal byte 29 in (INTTEMP.LOWBYTE / 2)....?
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
Lcdout $fe, 1, DEC INTTEMP.HIGHBYTE, " ", DEC (INTTEMP.LOWBYTE / 2)
GOTO INTERNALTEMP
end
Thanks,
John
Bookmarks