PDA

View Full Version : Long Integer to ASCII Numbers Conversion



tlb
03-23-2013, 02:53 AM
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

MichaelMeissner
03-23-2013, 05:32 AM
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.).