CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Printf and graphics lcd routines

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Dave_blade
Guest







Printf and graphics lcd routines
PostPosted: Fri Feb 02, 2007 7:03 am     Reply with quote

Can printf be used with CCS'S graphics driver file.
Regards all
Dave
VanHauser



Joined: 03 Oct 2005
Posts: 88
Location: Ploiesti, Romania

View user's profile Send private message

PostPosted: Fri Feb 02, 2007 9:47 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group