Shop OBEX P1 Docs P2 Docs Learn Events
converting to ascii — Parallax Forums

converting to ascii

jsestijsesti Posts: 5
edited 2009-07-03 10:52 in Propeller 1
is there a command that allows me to convert a value·to ascii?

thanks

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-07-02 16:09
    jsesti,

    Take a look at "Simple_Numbers.spin" located in the directory that you installed the Propeller IDE.

    What you have to do is basically look at each digit and then offset each digit by $30.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • jazzedjazzed Posts: 11,803
    edited 2009-07-02 16:20
    And if you give him $60 USD, you can get double the values [noparse]:)[/noparse]
    Of course, $30 means hexadecimal 30, binary 110000, or decimal 96 48. (AJM yup, saw too many 0's I guess).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230

    Post Edited (jazzed) : 7/2/2009 5:25:13 PM GMT
  • AJMAJM Posts: 171
    edited 2009-07-02 17:12
    decimal 48 rather?
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-07-03 10:52
    Hello

    as a global answer to your global question "is there a command that allows me to convert a value to ascii?"

    the global answer is: Yes.

    If I would stop writing here it would be unsatifying.

    The FullDuplexSerial-object and it's derivates FDX+, Extended_FDSerial etc. have a method
    DEC.
    You call this method with a value as parameter and the method is sending out a single character or a string which is the ascii-code or ascii-codeS of the digits
    of the value.

    But there are many other ways how your question could meant to be.

    So please describe in detail what you would like to do in the end.

    best regards

    Stefan
Sign In or Register to comment.