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

Flex_LCD, controlling cursor shift

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



Joined: 27 Jul 2007
Posts: 33

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

Flex_LCD, controlling cursor shift
PostPosted: Fri Feb 01, 2008 4:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Feb 01, 2008 12:17 pm     Reply with quote

Use this function to set the cursor position:
Quote:
lcd_gotoxy(x,y) -- Set write position on LCD (upper left is 1,1)
Guest








PostPosted: Fri Feb 01, 2008 12:21 pm     Reply with quote

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

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

very similar
PostPosted: Fri Feb 01, 2008 3:49 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Feb 01, 2008 4:05 pm     Reply with quote

See these posts:
http://www.ccsinfo.com/forum/viewtopic.php?t=24668
http://www.ccsinfo.com/forum/viewtopic.php?t=20237
PAPALUJA



Joined: 12 Feb 2012
Posts: 6
Location: SOUTH AFRICA

View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger

writing on cgram
PostPosted: Tue Feb 14, 2012 9:35 am     Reply with 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 (what a nice driver!!)?
_________________
C CCS FOREVER!
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Feb 14, 2012 1:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 14, 2012 3:06 pm     Reply with quote

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.
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