NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Convert uint8_t to char
January 31, 2010 by saleem |
Hi, I would like to display value from PORT PIN to LED Marquee - the function below accepts a char parameter: //From Nerdkit LED Marquee sample void font_display(char c, uint8_t offset) {
I read a value from Port like this: uint8_t value = PIND (for example) now I want to pass this value to font_display(value,1) it doesn't work! How can I cast uint8_t to char. Thx Saleem |
---|---|
January 31, 2010 by pbfy0 |
I think just doing this would work.
you need to add '0' so you get the so if PINB's 0 you get the character 0 instead of the number 0 (ascii null) |
February 01, 2010 by saleem |
Thanks pbfy0, That worked. Saleem |
Please log in to post a reply.
Did you know that one NerdKits customer controlled a laser pointer with his computer using a microcontroller? Learn more...
|