View previous topic :: View next topic |
Author |
Message |
jelodavid
Joined: 03 Apr 2005 Posts: 22 Location: Laguna Philippines
|
displaying characters on specific lcd location |
Posted: Wed Apr 06, 2005 9:17 pm |
|
|
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
|
|
Posted: Wed Apr 06, 2005 9:27 pm |
|
|
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
|
|
Posted: Wed Apr 06, 2005 9:42 pm |
|
|
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
|
|
Posted: Wed Apr 06, 2005 10:02 pm |
|
|
That's because you have the \f in there. It clears the screen and
homes the cursor. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Wed Apr 06, 2005 10:09 pm |
|
|
You also have the x & y coordinates swapped. You have:
This will try to put the cursor at column 1 of line 5. You want column 5 of line 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
|
|
Posted: Wed Apr 06, 2005 10:16 pm |
|
|
i get confused bcoz my lcd was mounted upside down. But i already got it. thanks a lot for very big help....... |
|
|
|