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

Problem in implementation of flex_kbd.c

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



Joined: 24 Apr 2009
Posts: 10

View user's profile Send private message

Problem in implementation of flex_kbd.c
PostPosted: Tue Oct 27, 2009 3:58 pm     Reply with quote

I'm new in this branch of programming and have tried to develop a function that would work more or less as follows.

This would read an array of keys using the library flex_kbd.c

The value could range from 1 to 3 digit, eg 5, 73 or 167.
When the # key is pressed the value typed so far would be assigned to a variable and it would be returned, since the function would be of type integer.

Example of use.
read_kbd value = ();

I'm trying to do this two weeks ago, yes ... I have not done well with this guy flex_kbd.c: P

Has anyone done something similar?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 27, 2009 4:24 pm     Reply with quote

The flex keypad driver uses software polling, similar to the CCS kbd.c
driver. My impression is that you want a function similar to getc()
for the UART, except that it's for a keypad.

This post might be useful to you:
http://www.ccsinfo.com/forum/viewtopic.php?t=39585&start=1
It takes push-button code that also requires polling, and it does the
polling in an interrupt routine. Then it takes the button press (if any)
and puts it in a circular buffer (similar to the CCS example Ex_sisr.c).
You then call the get_button() routine to get a button press.

You could modify that code to work with the flex keypad driver instead.
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