Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Long Integer to ASCII Numbers Conversion

  1. #1

    Long Integer to ASCII Numbers Conversion

    I'm starting to play with my Teensy 2.0 and have USB serial transmitting. For my project, I need to send back ASCII numbers for a 24 bit binary value. Before I write the code myself, I was wondering if anyone had a piece of code I could "leverage". Hopefully written relatively efficiently for the AVR.

    Thanks

    TLB

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,952
    Well there is the standard Stream.print and Stream.println that convert a long variable and write it to the USB monitor (println also prints a newline after printing out the integer). Print/println have different functions, that will do the printing based on the type of the argument (String, char, int, long int, unsigned long, double, etc.).

Posting Permissions

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