How to convert a HSERIN string to a hex value?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    20

    Default How to convert a HSERIN string to a hex value?

    This is probably an obvious newbie question, but my Google-Fu is failing me.

    I have a PIC connected to a PC via a serial interface. When I type "42" on my keyboard and press enter, I would like to store the integer value of 42 (or, preferably it's hex value of 2A) into a PBP variable. How do I do this? I've only been able to figure out how to store the ASCII value of the "4" and "2" characters. Thanks!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ShortBus View Post
    This is probably an obvious newbie question, but my Google-Fu is failing me.

    I have a PIC connected to a PC via a serial interface. When I type "42" on my keyboard and press enter, I would like to store the integer value of 42 (or, preferably it's hex value of 2A) into a PBP variable. How do I do this? I've only been able to figure out how to store the ASCII value of the "4" and "2" characters. Thanks!
    Not so obvious . . . I do not use the hyper term in windows . . I use real Term, http://realterm.sourceforge.net/ , from which you can select the option of sending the ascii representation or the real number to your PIC from the PC. The PIC can use any format you choose ascii, hex, dec, http://www.melabs.com/resources/pbpmanual/ look under hserin.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jun 2007
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Nevermind. I found what I needed:
    Code:
    HSERIN 10000, main, [DEC2 MyVar]

Similar Threads

  1. HSERIN for variable length string
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 19th February 2010, 05:58
  2. parsing string from hserin
    By xxxxxx in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 2nd April 2009, 18:42
  3. Converting Dec word to Hex string
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th August 2007, 05:44
  4. How to convert HEX Value as formatted BIN String ?
    By Robson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2007, 02:16
  5. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39

Members who have read this thread : 1

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