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

LCD Cursor Quickie

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



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

LCD Cursor Quickie
PostPosted: Wed Oct 05, 2005 1:33 pm     Reply with quote

I'm getting deeper into displaying menu pages and I need to be able to enter 3 digit numbers. I am writing the routines that will accept the keypresses and display the numbers. I would like to use a cursor on pages that require data entry and no cursor on pages that don't. From my searching I see that cursor attributes are set during the lcd_init.

How can I change cursor attributes (cursor on and flash) on the fly? Do I just re-init the LCD with each change? Or can I just set the new attributes?

Thanks,

John
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 05, 2005 2:06 pm     Reply with quote

Use the lcd_send_byte() function, with the first parameter set to 0,
and then refer to the following post for the 2nd parameter:
http://www.ccsinfo.com/forum/viewtopic.php?t=20237&highlight=lcd+cursor
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Wed Oct 05, 2005 3:15 pm     Reply with quote

Thanks PCM,

I had found your post in my readings and I had pasted those parameters into my lcd.c file for future reference . I just wasn't sure about how to set just the cusrsor stuff.

John
edhaslam



Joined: 15 Jul 2005
Posts: 89
Location: UK

View user's profile Send private message

Re: LCD Cursor Quickie
PostPosted: Fri Oct 07, 2005 2:46 am     Reply with quote

jecottrell wrote:
I'm getting deeper into displaying menu pages and I need to be able to enter 3 digit numbers. I am writing the routines that will accept the keypresses and display the numbers. I would like to use a cursor on pages that require data entry and no cursor on pages that don't. From my searching I see that cursor attributes are set during the lcd_init.

How can I change cursor attributes (cursor on and flash) on the fly? Do I just re-init the LCD with each change? Or can I just set the new attributes?

Thanks,

John


John,

Do you have any good links to menu building and in particular inputting data to an LCD via the keypad? I too am about to embark on this for a project I'm working on.

Ed
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Fri Oct 07, 2005 9:11 am     Reply with quote

No, I didn't find any silverbullets or snippets that prevented large amounts of coding.

I am using a "state machine" scheme. I store menu lines in EEPROM and when I change from one state to the next I send the new menu display to the LCD. (I send the menu display to the LCD upon leaving the previous state.) Search for "state machine" and you'll find a simple boilerplate using switch statements. That was my starting point.

To enter digits for numerical data just think about this:

display = (display * 10) + keypress

BTW, I have found specific questions (usually from at least attempting the task) get answered very quickly in the forum. General questions don't elicit many responses because they imply an attempt hasn't been made. I'm new to all of this and I like to ask general questions too. Mostly about "which is better", etc. But they don't generally get much interest.

Good luck,

John
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