Shop OBEX P1 Docs P2 Docs Learn Events
Question about hooking up buttons.... — Parallax Forums

Question about hooking up buttons....

jknightandkarrjknightandkarr Posts: 234
edited 2010-12-27 12:25 in Propeller 1
I don't see that there would be an issue, but would it work to take a 3.3v DC supply & run it into a momentary pushbutton, then out from the button to a 150 ohm resistor & finally to I/O pins on the Propeller or into shiftregisters? Like I said being 3.3v I don't see an issue here. I'm working on a project & the layout is very cramped on my display side & there isn't room for resistors like the buttons circuit on the PPDB uses.

Joe

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2010-12-27 11:48
    No, because when the switch is open there is nothing pulling the pin to ground. Why don't you replace the 150 ohm resistor with either a 10K between the pin and +3V3 and the switch between the pin and ground OR a 10K between the pin and ground and the switch between the pin and +3V3 ?
  • Nick McClickNick McClick Posts: 1,003
    edited 2010-12-27 12:01
    When the switch is open, you need resistor to keep the pin in a known state. Otherwise, you won't be able to reliably read the state of the switch. Usually I use a 10k pull down resistor before the switch. The other side of the switch is connected to 3volts. Nothing wrong with using a current limiting resistor on the other side of the switch, although it isn't necessary with the prop. Here's a sample circuit;
    code_flow_schematic_thumb.png
    you can disregard the LED's.
  • jknightandkarrjknightandkarr Posts: 234
    edited 2010-12-27 12:25
    I've got it figured. Looking over my Prop Ed Labs file. I'll take 3.3v into the switch & then out to the Propeller & into a 10K ohm resistor & onto ground. Been a long time since I've gotten to work on my electronics that I forgot about that. Thanks for the help.

    Joe
Sign In or Register to comment.