Hex to Ascii to Decimal


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Location
    USA
    Posts
    36

    Question Hex to Ascii to Decimal

    I'm using serin and serout to communicate with a graphics module. Everything is working fine, but I can't figure out how to convert the incoming data to something useable (killed too many brain cells, I guess).

    When the module sends a value like 30, it sends it in two bytes: 49 and 69.

    49 = $31 = "1"
    69 = $45 = "E"
    $1E = 30

    The question is how to do the above with PBP.

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    Take a look at HEX2 var modifier in the SERIN / SEROUT command

    this will translate var to 2 bytes of HEX

Similar Threads

  1. Convert long binary number to ASCII Decimal
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th July 2009, 13:58
  2. Need help converting to ASCII Hex format
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th August 2007, 19:14
  3. hex ascii help please
    By ffr58kk90 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 29th December 2006, 21:09
  4. Converting ASCII to HEX
    By BobP in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th September 2006, 10:21
  5. Reading a Hex value from a Modem and showing it as Decimal..
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th March 2005, 17:58

Members who have read this thread : 2

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

Posting Permissions

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