Tactile switches for L and R buttons

General GBZ-related chat goes here. Share ideas, tips and tricks, or ask questions that don't fit into the hardware/software help forums.
Post Reply
TilenB
Posts: 25
Joined: Fri Nov 04, 2016 4:31 am
Has thanked: 1 time
Been thanked: 2 times

Tactile switches for L and R buttons

Post by TilenB » Mon May 08, 2017 4:32 pm

Hi,
so for my project i decided to use tactile switches for L and R buttons. My question here is, how do I wire them to the Pi ? I'm using the GPIO method and this board:
17028759_1967678170186104_625899657_n.jpg
17028759_1967678170186104_625899657_n.jpg (21.65 KiB) Viewed 10704 times
Switches:
Image


TilenB
Posts: 25
Joined: Fri Nov 04, 2016 4:31 am
Has thanked: 1 time
Been thanked: 2 times

Re: Tactile switches for L and R buttons

Post by TilenB » Tue May 09, 2017 2:37 am

thank you, but how do I know which pins are ground and which are positive?

User avatar
VeteranGamer
Posts: 1738
Joined: Thu Jan 26, 2017 11:12 am
Location: London, UK
Has thanked: 528 times
Been thanked: 909 times

Re: Tactile switches for L and R buttons

Post by VeteranGamer » Tue May 09, 2017 3:20 am

TilenB wrote:
Tue May 09, 2017 2:37 am
thank you, but how do I know which pins are ground and which are positive?


it doesnt make a difference, just pick a side


if you watch wermy guide it in there





you can fast forward to around 11:35 of the video

User avatar
abrugsch
Posts: 971
Joined: Tue Aug 02, 2016 10:00 am
Has thanked: 356 times
Been thanked: 430 times
Contact:

Re: Tactile switches for L and R buttons

Post by abrugsch » Tue May 09, 2017 4:26 am

switches are not directional. however, with tact switches, of the 4 pins, 2 are connected to each other. (and the other 2 are also connected to each other...) like so: pins 1 and 2 are connected, pins 3 and 4 are connected.

Code: Select all

    pin1------------pin2
               \
             /
    pin3------------pin4
when you click the switch, the 2 sides become connected to each other.

Code: Select all

    pin1------------pin2
              /
             /
    pin3------------pin4
as long as you make sure you connect one 'side' to gnd and the other to your GPIO pin, then it doesn't matter which way round it goes. I can't off the top of my head remember if it's the long side or the short side that's connected but with a meter or a light and battery circuit it should be easy to determine. (or just google it ;) https://electronics.stackexchange.com/q ... breadboard )
if in doubt just use opposite corners

User avatar
fernandinho1337
Posts: 37
Joined: Sat Nov 12, 2016 2:07 pm
Location: Germany
Has thanked: 13 times
Been thanked: 5 times

Re: Tactile switches for L and R buttons

Post by fernandinho1337 » Tue May 09, 2017 5:48 am

look at the picture you posted.
the two pins that are "on top" are connected as well as the two bottoms ones.

best regards
Who is "Jessie" and why does he like pi(e)?

TilenB
Posts: 25
Joined: Fri Nov 04, 2016 4:31 am
Has thanked: 1 time
Been thanked: 2 times

Re: Tactile switches for L and R buttons

Post by TilenB » Thu May 11, 2017 11:26 am

so one of two goes to gpio and one of two to ground?

TilenB
Posts: 25
Joined: Fri Nov 04, 2016 4:31 am
Has thanked: 1 time
Been thanked: 2 times

Re: Tactile switches for L and R buttons

Post by TilenB » Thu May 11, 2017 11:28 am

I mean like
x----x->one to gpio
/
x----x->one to ground


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest