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
Posted: Tue Oct 27, 2009 4:24 pm
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.
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