Basic Stamp Project
Coopdaddy
Posts: 1
Trying to make an Electronic Locking device using 4 button sequence activation. Was going to use a keypad from an old push telephone, going to have to use 4 momentary switches, need help on getting started on the program.
Comments
What hardware materials do you already have? For example, do you have a BASIC Stamp 2 w/ Board of Education? With this information, we can get an idea for what you have, and offer advise.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Respectfully,
Joshua Donelson
www.parallax.com
I am very new to this. I have the basic stamp 2 BOE.
What I am trying to do is have for example 4 push buttons, in pins 1-4 numbered 1-4.
Say I push 4231 in sequence a green LED will come on hooked threw pin15. If it is not in that sequence a red LED will come on in P14.
I just cant figure out how to tell the stamp to do this when...
button 4 is pressed then unpressed
button 2 is pressed then unpressed
button 3 is pressed then unpressed
button 1 is pressed then unpressed
then turn on "high" p15
if not high p14
Can someone help me out?
Thanks
There are common bus output keypads but they are extremely hard to source, No suppliers i can find in the UK and only one ive managed to find stock them in the US.
Therefore you would need to sacrifice pins on your stamp to decode a matrix type or purchase a seperate decoding circuit.
Have to resort to making my own in diptrace with momentry switches
also have you looked at this chip
www.datasheetcatalog.org/datasheet/lsi/LS7220.pdf
Post Edited (skylight) : 11/1/2009 2:59:41 PM GMT
if 4 then
if 2 then
if 3 then
if 1 then light green led
else light red led
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I think basically what I am looking for is a command·to·turn the light on when the button is pushed then released.
Ive got this with 2 push buttons on 0 and 1
and red led on 14 and green led on 15
' {$STAMP BS2}
' {$PBASIC 2.5}
DO
IF IN0=1 AND IN1=1 THEN
HIGH 15
LOW 14
PAUSE 10000
LOW 15
ELSE
HIGH 14
ENDIF
LOOP
the problem is I have to push both buttons at the same time. I want to push 0 then release then 1 then release then the light comes on...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Something like:
S1: Button 4 Pressed?
Yes - goto S2
No -- goto S1
S2: Button 4 Released?
Yes - goto S3
No -- goto S2
S3: Button 2 Pressed?
Yes - goto S4
No -- goto S1 (or goto the Error Handling routine...)
S4: Button 2 Released?
... and so forth and so on.
--Rich