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 support@ccsinfo.com

Nokia 3310 lcd driver help

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



Joined: 29 Aug 2010
Posts: 11

View user's profile Send private message Send e-mail Yahoo Messenger

Nokia 3310 lcd driver help
PostPosted: Mon Sep 12, 2011 4:27 am     Reply with quote

Please since a see this http://www.ccsinfo.com/forum/viewtopic.php?p=150398 code I don't know how to put variable on it. Please can somebody help me. It is too much important for me at the time I'm writing Wink
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 12, 2011 4:11 pm     Reply with quote

In his main() code, he has this:
Quote:

void main()
{
NOKIA_INIT();
NOKIA_GOTOXY(1,1);
printf(nokia_printchar,"M.Yasser");
NOKIA_GOTOXY(20,10);
PRINTF(NOKIA_PRINTCHAR,"A Test!!");
printF(nokia_printchar,"NOKIA 3310 LCD");
while(1);
}

He's displaying constant strings. So I guess your question is how to use
printf to displays a string array, or how to display numbers.

Download the CCS manual and put it on your desktop.
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
Look in the section on printf. It shows the template of how to do it:
Quote:

printf (fname, cstring, values...)

fname = nokia_printchar
cstring = the format string used to display the desired type of variable.
values = the variables that you want to display.

Here is an example of how to display an 8-bit unsigned variable in
decimal format:
Code:

void main()
{
int8 temp;

nokia_init();
nokia_gotoxy(1,1);

temp = 25;

printf(nokia_printchar, "%u", temp);

while(1);
}

To display other variables of a size larger than 8-bit, or a different type
than an integer, etc., then read the CCS manual and look at the format
strings in the printf section, such as %lu, %x, %lx, %f, %7.3f, etc.
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