View previous topic :: View next topic |
Author |
Message |
pokiko
Joined: 27 Jul 2007 Posts: 33
|
Flex_LCD, controlling cursor shift |
Posted: Fri Feb 01, 2008 4:14 am |
|
|
I use Flex_LCD. I am a using 2x16 HD44780 compatible LCD. I have to write two of 4 digit numbers to the first row of the LCD screen. During this operation, I have to control the shift right/left cursor position by two buttons and i must be able to write at the desired cursor position which means that i must change each digit seperately. Thus, i have to control writing too. How can i achieve cursor shifting with a simple function by using flex_LCD driver.
what i am looking for is maybe adding an array element to Code: |
int8 const LCD_INIT_STRING[4] =
{
0x20 | (lcd_type << 2), // Func set: 4-bit, 2 lines, 5x8 dots
0xc, // Display on
1, // Clear display
6 // Increment cursor
}; |
Then by using the element, to control shifting the first row. Such as at the post ttp://www.ccsinfo.com/forum/viewtopic.php?t=31268&highlight=lcd+cursor I am not too good in c so any ideas? or is this possible in flex, am i in the right way |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 01, 2008 12:17 pm |
|
|
Use this function to set the cursor position:
Quote: | lcd_gotoxy(x,y) -- Set write position on LCD (upper left is 1,1) |
|
|
|
Guest
|
|
Posted: Fri Feb 01, 2008 12:21 pm |
|
|
I make a project with a LCD having 4x40 characters.
Using Menus ( 7 menus ). Each menu is displayed with a number of parameters.
This parameters can be changed using cursor.
This change is simply made by placing the cursor at the right place, then write numbers between two positions.
After this, I read the LCD ( at this position ). And place the result to update the parameters in my program.
For example : create a menu CODE with XXXX. Then placing the cursor at this place . Enter the code. Then read the code. If code is good, then I can see other menus.
Is it something like that you want ? |
|
|
pokiko
Joined: 27 Jul 2007 Posts: 33
|
very similar |
Posted: Fri Feb 01, 2008 3:49 pm |
|
|
it is very similar except i won't read from LCD. I'll only write to LCD. User will set the numbers. And the main problem is, i have to change the LCD's cursor position and blinking only at the specific locations with two buttons shifting between digits of 3,4,5,6, and 11,12,13,14. The cursor musn't to be seen at locations of 1,2,7,8,9,10,15,16. Is it possible and is there a way to achive this.
A = - - - - B = - - - -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -->LCD DDRAM
sorry i couldn't match the digits. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
PAPALUJA
Joined: 12 Feb 2012 Posts: 6 Location: SOUTH AFRICA
|
writing on cgram |
Posted: Tue Feb 14, 2012 9:35 am |
|
|
I am busy with a project that needs me to write on CGRAM of lcd because I want to create a user defined pattern. Can anyone provide with a simple c code driver like flex_lcd (what a nice driver!!)? _________________ C CCS FOREVER! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Tue Feb 14, 2012 1:54 pm |
|
|
Well we're all busy....You could look in the Code Library to see if someone else has posted code or use Google to search the Web.
It ain't rocket science, about 20 lines of code I recall, from doing that about 13 years ago.
I'll make you a deal. Supply me with code that allows a Vinculum-II to be Host and Slave in UART mode with an 887 PIC and I'll send you the CGRAM code. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 14, 2012 3:06 pm |
|
|
Quote: | I am busy with a project that needs me to write on CGRAM of lcd because
I want to create a user defined pattern. Can anyone provide with a simple
c code driver like flex_lcd. |
Learn how to use the forum's search page. Go here:
http://www.ccsinfo.com/forum/search.php
Then type in a suitable search string:
Quote: |
custom lcd characters flex lcd
|
Also, set it to "Search for all terms". That's important.
Then you will find what you need. |
|
|
|