hex dec ascii


Closed Thread
Results 1 to 7 of 7

Thread: hex dec ascii

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default Re: hex dec ascii

    its an old program and not sure of the values, the value is correct from them but its in ascii rather than dec when outputed to lcd if I output to lcd dec3 v1 its fine I can put them on the screen side by side one reads d the other 100

    100 dec is d ascii

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: hex dec ascii

    Look, a byte variable can hold values from 0 to 255, that's it.
    All this DEC, HEX, BIN and ASCII stuff is just us humans expressing the same thing in different ways, 100=64=d=01100100.

    A character LCD is used to display stuff for humans to read so it "understands" ASCII. If a variable contains the value 100 and you send that to the LCD you'll get 'd' since 100 is the ASCII code for 'd' (exactly as you say). If you want to display the numeric value of the variable AS ASCII then you use the DEC modifier. The DEC modifier does in no way change the value.

    If you do LCDOUT $FE, 1, DEC V1 and the display shows a value of more than 100 then If V1>100 then High PortA.5 statement WILL evalute true and the problem is with controling PortA.5.

  3. #3
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default Re: hex dec ascii

    OK after HenrikOlsson spanking I started checking from his line of thinking putting in a fast blink between steps and it was hanging at a serin command and not getting value into V! also found I was missing an ADCON1 = %1111
    statement so it is working, guess I needed a slap

Similar Threads

  1. HSERIN/OUT Dec to HEX convertion problem..
    By N6VMO_ in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 26th July 2010, 21:48
  2. DEC to ASCII not working in HSEROUT
    By SunDanzer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd July 2009, 06:11
  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. Convert dec/binary to Hex
    By SagemFree in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th May 2005, 18:00
  5. Converting Bytes from hex to Dec
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th April 2005, 19:44

Members who have read this thread : 0

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