stupid question ...
bkiba
Posts: 17
How would one go about setting up the basic stamp (BS2PE or BS2) to detect if a switch is thrown. I'm not talking about the 4 pin switches that come with the kits, I'm talking about a regular on off switch, with 2 pins.
I have a 4 key, illuminated key pad. two pins are for the LEDs, so + and - for those. Then there are 5 more pins, a common pin and a pin hooked to each individual key. When a key is pressed and held, the pin for that key and the common short. I'm trying to use the IN# command and debug the IN0, IN1, IN2, IN3 that I have the key pins hooked too, but it seems like whenever I press a key, the IN0-IN3 values randomly decide what they will be, with no repeatability.
Thanks
I have a 4 key, illuminated key pad. two pins are for the LEDs, so + and - for those. Then there are 5 more pins, a common pin and a pin hooked to each individual key. When a key is pressed and held, the pin for that key and the common short. I'm trying to use the IN# command and debug the IN0, IN1, IN2, IN3 that I have the key pins hooked too, but it seems like whenever I press a key, the IN0-IN3 values randomly decide what they will be, with no repeatability.
Thanks
Comments
"...When a key is pressed and held, the pin for that key and the common short. I'm trying to use the IN# command and debug the IN0, IN1, IN2, IN3 that I have the key pins hooked too, but it seems like whenever I press a key, the IN0-IN3 values randomly decide what they will be..."
If the "common pin" is GND, you need to use a pull-up resistor to Vdd with a value somewhere between 1K and 100K on each "pin for that key".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Keypads usually don't have each key attached to a pin, The first thing you should do is find the schematics for the key pad you are using, (googgled) or find the manufacturer web site.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fernando Gomez
revinc.us
gomez-rivera.com
Never compare yourself with anyone else, there will always be someone bigger·or·smaller·than you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
The keypad is a storm backlit 4 button keypad.
It has a 7 pin connector
pin 1 - Cathode for LED
pin 2 - common
pin 3 - key D
pin 4 - key C
pin 5 - key B
pin 6 - key A
pin 7 - anode for LED
I've been pretty successful so far with electronics, I've never actually had a course or training on this stuff, so could you please explain what a pull up resistor is? Are you saying each pin 3-6 needs a resistor or just the ground/common pin?
thanks again!
www.seattlerobotics.org/encoder/mar97/basics.html
Pull up resistor is the first topic discussed.
Good basic tutorial on electronics.
phil