Shop OBEX P1 Docs P2 Docs Learn Events
Problem getting the Stamp to recognize input from a BCD switch — Parallax Forums

Problem getting the Stamp to recognize input from a BCD switch

margogmargog Posts: 2
edited 2009-05-20 21:10 in BASIC Stamp
Hi!
We are trying get the stamp to recognize input from a BCD switch connected to pins 12 - 15 on a Parallax Stamp, Board of Education using PBasic 2.5. The problem is that, no matter what we set the switch to, the Stamp still thinks it's set to 0.

I've attached my few lines of code and next, the data sheet for the BCD switch we are using.

Many thanks for your help!
Margo

Comments

  • JomsJoms Posts: 279
    edited 2009-05-20 20:11
    Can we see a schamatic of how you have your switch connected to the stamp? Maybe you have a pull up/down resistor in the wrong place?
  • margogmargog Posts: 2
    edited 2009-05-20 20:43
    > Can we see a schamatic of how you have your switch connected to the stamp? Maybe you have a pull up/down resistor in the wrong place?

    We don't have any email-able schematic, but I can give you the details:

    The 1-pin of the switch is connected to Pin 12 of the Stamp.
    The 2-pin of the switch is connected to Pin 13 of the Stamp.
    The 4-pin of the switch is connected to Pin 14 of the Stamp.
    The 8-pin of the switch is connected to Pin 15 of the Stamp.

    Currently, the Common-pin of the switch is connected to ground (though we've tried it without being grounded, but it makes no difference, either way.)

    On each connect a switch pin and a Stamp pin is a diode (1N4148) with the band towards the switch.

    No Pull-up or pull-down resistors are used.

    I hope this is enough to let you see how it's hooked up ... thanks!
    Margo
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-20 21:10
    You need pullup resistors (10K to +5V) and you should remove the diodes. Look at the examples in "What's a Microcontroller?" for connecting single switches to a Stamp. It's the same idea.
Sign In or Register to comment.