Keypad 8x7

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
alainc
Posts: 9
Joined: 19 Jul 2009 13:17

Keypad 8x7

#1 Post by alainc » 19 Jul 2009 13:21

Hi i have a keypad 7 rows by 8 columns is there a way to interface it
using Mikro Basic for a 24fj128GA010. Thanks in advance! Alain

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#2 Post by jpc » 19 Jul 2009 13:44

scanning a matrix is a rather simple task, you should have no trouble interfacing this keyboard . For the basics look at something like http://www.dribin.org/dave/keyboard/one_html/. It is obvious you will have to write the fucntion for this yourself. An elegant way is to setup a timer-interrupt at for example 1 ms, scan one column each interrupt and count a few successive 'hits' to achieve debouncing.
Au royaume des aveugles, les borgnes sont rois.

alainc
Posts: 9
Joined: 19 Jul 2009 13:17

#3 Post by alainc » 19 Jul 2009 14:44

Thanks jpc!
Is there a way modify the compiler module for keypad interface (4x4)
to interface my (7x8) keypad?

alainc
Posts: 9
Joined: 19 Jul 2009 13:17

#4 Post by alainc » 19 Jul 2009 14:47

Is it possible to port this C code to MikroBasic ??

const uint8 au8_keyTable[NUM_ROWS][NUM_COLS] = { {'7', '8', '9', 'e', ' ', ' ', ' ', ' '},
{'4', '5', '6', 'b', ' ', ' ', ' ', ' '},
{'1',' 2',' 3', 'a', ' ', ' ', ' ', ' '},
{' ', ' ', ' ', ' ', 'c', 'd', ' ', 'o'},
{' ', ' ', ' ', ' ', 'f', ' ', 'g', 'h'},
{' ', ' ', ' ', ' ', 'i', ' ', 'j', 'k'},
{' ', ' ', ' ', ' ', 'l', ' ', 'm', 'n'}};

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#5 Post by jpc » 19 Jul 2009 14:48

i think not as you have no access to source-code, you must do it yourself, should be no problem. I am sure you can do a better job by using the concept i gave.
Au royaume des aveugles, les borgnes sont rois.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#6 Post by jpc » 19 Jul 2009 14:52

the 'code' is only a constant declaration, it would be very similar in Basic i suppose. Once you have row and column youcan use something similar to assign the right value to a key.
Au royaume des aveugles, les borgnes sont rois.

alainc
Posts: 9
Joined: 19 Jul 2009 13:17

#7 Post by alainc » 19 Jul 2009 14:59

OK Thanks i will try to port this code. Merci A+

Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”