PDA

View Full Version : ede 1144 keypad help



turboEK2000
04-26-2006, 08:17 AM
I'v been working with the ede 1144 keypad encoder, and I'm new to programming so this should be simple for someone else, I got everything to work properly and have the encoder output decimal numbers to debug without a problem (long bulky code I know but it works for me). but now I want to have to push 4 buttons in a row to light an LED, obviously this is for a security system of some sort. here is the code I have right now, the part that says “security pass” is my problem, its set up for just 2 buttons 2 and 8, it looks like it should work but I don’t know, it doesn’t…



Post Edited (turboEK2000) : 4/26/2006 12:26:01 AM GMT

Chris Savage
04-26-2006, 08:59 AM
I'm not sure about the way your code flows, but here is a subroutine I wrote some time ago for the EDE1144 and updated.· Perhaps it will be easier to understand.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

turboEK2000
04-26-2006, 09:14 AM
I got that part to work with the decimal numbers, here it is·using your code maybe·this looks familiar.

Chris Savage
04-26-2006, 09:20 AM
Okay, I think I see what you mean...You're trying to accept a 4 digit number or code as a password and activate an LED and perhaps a lock?· The routine I posted is one of three keypad routines I use as a sub in my code.· Two are from Security Alarm Systems I built some years ago.· This sub should be called each time you want a keypress and RETURN to the routine building the array of digits.· I used to use the ScratchPad RAM on the BS2p40, but in fact you don't even need to do this.· If you want you can compare on the fly.· Jon Williams wrote the RFID Demo that compares an authorized tag with a DATA table.· That may help you.· Basically what you want to do is compare each keypress one at a time with the valid code and as soon as you have an invalid character you exit that routine.· In my code I increment a counter.· Three strikes and you're out (The Alarm sounds).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

turboEK2000
04-27-2006, 09:09 PM
I looked at your code but·it doesn’t look like anything you said is in there, about comparing numbers and going to RETURN. I understand what you’re saying but I have no idea how I would go about coding this, do you have a·simple example???

Chris Savage
04-27-2006, 10:13 PM
I never said that routine did all that.· I said that was the subroutine I called to get the keypresses and then compared them with stored strings in DATA statements.· Since that code was part of a Security System sold and in use today I did not include those routines.· I did offer a source for routines to compare stings received from a device in a similar manner.· If you want to wait a day perhaps tonight I would throw something together that is similar, but my routines included a modified version of that subroutine which also handled timeout on entry so the program didn't sit there forever waiting for the keypresses.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

turboEK2000
04-29-2006, 10:00 AM
I'm still lost if someone could tell me why the heck this code doesnt work, that would be nice, this would only be for 2 digits...

startover:

'above this would just be the SERIN and the code to correct hex to dec

IF·keypad = 2 THEN GOTO me1 ELSE GOTO startover

me1:
IF keypad = 8 THEN GOTO me ELSE GOTO startover

me:
HIGH 3
PAUSE 200
LOW 3

LOOP


Post Edited By Moderator (Chris Savage (Parallax)) : 4/29/2006 3:22:31 AM GMT

PJ Allen
04-29-2006, 10:32 AM
What happens with this? --

' {$STAMP BS2}
' {$PBASIC 2.5}

DIRS = $0F 'MSB INs, LSB OUTs

LOW 3

inkey VAR Byte

goround:
SERIN 12, 84, [inkey]
IF inkey = $32 THEN chunkit ' looking for a "2"
GOTO goround ' didn't get a two

chunkit:
HIGH 3
PAUSE 2000
LOW 3
GOTO goround

Please strike the expletive from your previous post, I think we try to keep it clean around here.

Post Edited (PJ Allen) : 4/29/2006 3:09:03 AM GMT

Chris Savage
04-29-2006, 11:23 AM
PJ,

·· Expletive removed...That's twice in two days on that one...

Now, for the OP, I will get my EDE1144 out right now and churn something out for you tonight...It may benefit others and I meant to do that anyway.· Be patient.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Chris Savage
04-29-2006, 01:14 PM
Okay,

·· I have everything wired up and like 90% of the code done but I am fading so I will pick this up in the morning...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Chris Savage
04-30-2006, 08:26 AM
Okay,

·· I say down and quickly put together something that simulates a password entry system without infringing on any customer code I have written.· So this code isn't very neat or necessarily the beast/easiest way to do this but it gets the job done.· Anyone should feel free to optimize or change it as they see fit.· I basically took the EDE1144 subroutine code I posted which translates the keypresses and remaps them for a given keypad and added this little routine.

·· The routine works as follows.· Generally in an alarm system an event will trigger a prompt for your password.· This system waits for you to press a key on the keypad then prompts you (on the Parallax LCD) for your password.· You punch it in followed by pressing the "A" key (See my layout) and the password is compared to the one in the EEPROM (DATA statement).· If they match you get the appropriate message and if not, you are "unauthorized!".

·· In an alarm system you need to timeout if the person doesn't press a key or you cannot continue with your normal functions as you would be stuck wait for a keypress.· So this code has a very simple timeout function so that if no key is pressed within a certain time it "times out" and restarts.· Bear in mind you would need to handle this differently in a real alarm system but the code shows one way to implement such a timer.· I hope this helps the OP and anyone else who isn't sure how to read multiple keypresses from the EDE1144 or EDE1188 and do something with the data.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

turboEK2000
04-30-2006, 09:54 AM
THANKS I don’t have time right now I’m going to take at look at the code tomorrow, not trying to be a jerk (I don’t think jerk is a curse) but last time I checked the english language "heck” wasn’t a cursehttp://forums.parallax.com/images/smilies/confused.gif·· I could do a lot worsehttp://forums.parallax.com/images/smilies/smilewinkgrin.gif

Post Edited By Moderator (Chris Savage (Parallax)) : 4/30/2006 3:37:20 AM GMT

turboEK2000
05-01-2006, 09:49 AM
you should remove these guys then---> ·http://forums.parallax.com/images/smilies/devil.gif http://forums.parallax.com/images/smilies/yeah.gifthey seem a little raunchy
oh my! is that what·I think it is!! http://forums.parallax.com/images/smilies/nono.gif·· its a little towards the :cough:center:cough:

lol i'm sorry its too funny, im just playin

Post Edited (turboEK2000) : 5/1/2006 1:52:34 AM GMT

Chris Savage
05-01-2006, 09:53 AM
So does this mean your code is working now?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

PJ Allen
05-01-2006, 10:01 AM
"Cast ye not pearls..."

turboEK2000
05-01-2006, 10:06 AM
iv been working the past 2 days and dead tired, and·school all day tomorow and finals and reports,·im gonna have to look at it like tues, I'm prob gonna order a serial lcd from the website tomorow, unless theres some way·you can convert a parallel lcdhttp://forums.parallax.com/images/smilies/confused.gif

ps. thanks for the code

PJ Allen
05-02-2006, 09:20 PM
turboEK2000 wondered...
unless theres some way·you can convert a parallel lcd
Here's one way --
http://www.allelectronics.com/spec/EDE-702.pdf
Better get the keypad reader squared away first.