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

displaying characters on specific lcd location

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



Joined: 03 Apr 2005
Posts: 22
Location: Laguna Philippines

View user's profile Send private message Yahoo Messenger

displaying characters on specific lcd location
PostPosted: Wed Apr 06, 2005 9:17 pm     Reply with quote

Good day to everyone!, I just wanna ask on how to display characters on specific loacation, e.g. display "Hello" on 1st line and 4th posistion of 2x16 LCD.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 06, 2005 9:27 pm     Reply with quote

Look in the LCD.C file for functions that support the LCD, along
with explanations of them. You will find the lcd_gotoxy() function.
The origin is the upper left cell, and its coordinates are 1,1.

LCD.C is in this folder: c:\Program Files\Picc\Drivers
jelodavid



Joined: 03 Apr 2005
Posts: 22
Location: Laguna Philippines

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Apr 06, 2005 9:42 pm     Reply with quote

thanks for immediate reply...

but it doesn't display on location i wanted.
Here's is the portion of my code...

lcd_gotoxy(1,5);
lcd_putc("\fTime");

it display on the upper left corner of the LCD...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 06, 2005 10:02 pm     Reply with quote

That's because you have the \f in there. It clears the screen and
homes the cursor.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Wed Apr 06, 2005 10:09 pm     Reply with quote

You also have the x & y coordinates swapped. You have:

Code:
lcd_gotoxy(1,5);


This will try to put the cursor at column 1 of line 5. You want column 5 of line 1:

Code:
lcd_gotoxy(5,1);


The way I remember it is that the x location comes first, the same as in the function name itself, lcd_gotoxy();
jelodavid



Joined: 03 Apr 2005
Posts: 22
Location: Laguna Philippines

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Apr 06, 2005 10:16 pm     Reply with quote

i get confused bcoz my lcd was mounted upside down. But i already got it. thanks a lot for very big help....... Smile Very Happy
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