HEX byte to ASCII output...


Results 1 to 6 of 6

Threaded View

  1. #1

    Default HEX byte to ASCII output...

    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
    Last edited by johnmaetta; - 12th August 2011 at 20:04. Reason: insert code

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts