Shop OBEX P1 Docs P2 Docs Learn Events
Switch and BS2 — Parallax Forums

Switch and BS2

CaipiCaipi Posts: 11
edited 2006-02-22 11:55 in BASIC Stamp
Hello,

yet anothet question. I had some fun working with the sumobot, but now I want to add a switch to select an operationg mode. My idea is to connect the 5V to a swich and the switch to an I/O pin. Is this a good idea or do I need a resistor in between?

Thx

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-22 01:25
    Not only do you need a resistor (220) between·the switch and I/O pin·but you need a pulldown resistor (10K) to pull the line low when the switch is open.· Otherwise your input value will change erratically.· See the attachment.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 2/22/2006 1:28:00 AM GMT
    255 x 202 - 7K
  • CaipiCaipi Posts: 11
    edited 2006-02-22 11:55
    Thx, I will give it a try
Sign In or Register to comment.