Yes, that is correct. Rest applies of course.
But don't be afraid of the word variable!
Ioannis
Yes, that is correct. Rest applies of course.
But don't be afraid of the word variable!
Ioannis
Hi all
The keypad code has been working very well ! Thanks mister_e!
Initially I had to wire alter the wiring to the keypad to the PIC to get things working now in order to match the header pins for PORT B on a dev board I am building I need to alter the include file somehow to match my keypad.
I was hoping someone could point me in the right direction for this or tell me where to change the code to match the desired pin configuration.
Here is what I have now:
EXISTING CONFIG (WORKING)
-------------------------
Columns Rows
______________ _____________
Keypad 7 6 5 4 3 2 1 0
PIC B4 B5 B6 B7 B0 B1 B2 B3
Here's what I would like to be
DESIRED CONFIG
--------------
Columns Rows
______________ _____________
Keypad 7 6 5 4 3 2 1 0
PIC B7 B6 B5 B4 B3 B2 B1 B0
I would appreciate any help/info
Kind regards
Dennis
Last edited by Dennis; - 7th January 2010 at 23:34.
Check the attached file
Dennis
Steve's keypad routines won't let you reverse the orders like that.
But you can re-map the keys to whatever you want.
By reversing both the columns and rows, I think it would come out like this ...
Which should also work like this ...Code:@ READKEYPAD _myvar ; original keys 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 LOOKUP myvar,[0,16,15,14,13,12,11,10,9,8, 7, 6, 5, 4, 3, 2, 1],myvarIf they don't line up right, you can change the LOOKUP to a pattern that matches.Code:myvar = 17 - myvar
hth,
DT
Thanks Darrel
Will give it a shot and feedback results here :-)
Dennis
Hi Darrel
Thanks for the assistance :-)
The LOOKUP change was the easiest solution !
originally I had thisAnd I just changed the line to thisCode:@ READKEYPAD _myvar 'read keypress variable and place in myvar LOOKUP myvar,[0,"123A456B789C*0#D"],myvar 'use lookup table to diplay proper keypress
Thanks a million , it saves me having to redo my dev board design or re-wiring the keypad :-) YAYCode:@ READKEYPAD _myvar 'read keypress variable and place in myvar LOOKUP myvar,[0,"D#0*C987B654A321"],myvar
Kind regards
Dennis
HI all,
I have been playing with this wonderful piece of code for many hours. Really cool code. I was having problems with one row of the keypad but the rest was working enough for me to proceed filling in the gaps and learning the lessons from the thread. I bring this up because I have been caught on it before, you would have thought I'd have learned....
The row in question would freeze the operation of the circuit. Upon looking closely at the datasheet, I my eye caught the LOW VOLTAGE PROGRAMMING option. A faint voice in my head reminded me that we were not friends (the option, not the voice). Yep, that was it. Disabled it in meLabs programmer and... you guessed it... runs just like it was suppose to. Who'd a thought it?
Hope that this saves someone else some head banging. Some gotchas I have to keep reminding myself about.
Bo
Bookmarks