VanHauser
Joined: 03 Oct 2005 Posts: 88 Location: Ploiesti, Romania
|
|
Posted: Fri Feb 02, 2007 9:47 am |
|
|
Of course it can be. You just need to give it a function that prints one character to the LCD. Assuming that you have a function like:
Code: | void glcd_putc(char c)
{
...
} |
all you have to do is:
Code: | printf(glcd_putc, "some text %u %lu", n1, n2); |
printf can be used like the usual way.
In the CCS graphics driver you must modify the function glcd_text57 that draws a string to draw only one character, like above. Before using printf with this, you must take care of positioning your cursor and automatically incremeting its position after every glcd_putc call.
Another way is to use sprintf to print text to a buffer array, and then use the graphics driver function glcd_text57 to output this buffer to the LCD. This would take care of the screen position incrementing. |
|