View previous topic :: View next topic |
Author |
Message |
pretyh8machin
Joined: 18 Oct 2011 Posts: 4
|
LCD Write position |
Posted: Tue Oct 18, 2011 11:28 pm |
|
|
So i was using the flex_lcd.c along with flex_kbd.c to interface a PIC with a keypad to an LCD. I was looking to implement some kind of counter where a user could input a number from the keypad to the lcd and i could use a button to make the value shown on the display count down. As of right now my keypad works meaning that as you write number they start on the first line of the lcd and writes in the direction of left to right.
I was looking to be able to write to the LCD from right to left for on the second row of the 2x16 LCD display without clearing the message of the first of the LCD. heres the code of the flex_lcd.c i am using. I think the void lcd_gotoxy(int8 x, int8 y) controls the line of cursor but i am not too sure how to use it. Any help or suggestions are welcome. Thank you in advance.
Code: |
// flex_lcd.c
#define LCD_DB4 PIN_D4
#define LCD_DB5 PIN_D5
#define LCD_DB6 PIN_D6
#define LCD_DB7 PIN_D7
#define LCD_E PIN_A2
#define LCD_RS PIN_A0
#define LCD_RW PIN_A1
// If you only want a 6-pin interface to your LCD, then
// connect the R/W pin on the LCD to ground, and comment
// out the following line.
#define USE_LCD_RW 1
|
http://www.ccsinfo.com/forum/viewtopic.php?t=24661 |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Oct 19, 2011 11:42 am |
|
|
Quote: |
I think the void lcd_gotoxy(int8 x, int8 y) controls the line of cursor but i
am not too sure how to use it.
|
Look at the demo program for the 20x4 flex lcd driver. It has several
lines where it sets the x,y cursor position. It puts a number in each of
the 4 corners of the lcd. You can see how to use the function:
http://www.ccsinfo.com/forum/viewtopic.php?t=28268 |
|
 |
|