1

I have the following on-off-on-off button that I purchased from Adafruit for use with my Raspberry Pi 1 Model A.

I'm trying to "bypass" the "on-off-on-off" functionality, and just make it so that its an "on-off" switch/pushbutton. I believe the wiring setup that I'm looking for is:

enter image description here

Where I'm:

  • Connecting the RPi's 3.3V power supply to the middle pin of my pushbutton (with a 10kOhm resistor in between them); then
  • Wiring the two outer pins (left and right) together and attaching them to the GPIO input pin

Can anyone confirm I have the wiring correct? Or is it the opposite (where the outer two pins go to GPIO instead of GND, and the middle pin goes to GND)? Or is the solution something completely different?

Again, the ultimate goal here is to be able to push the button once, and send an input signal to the GPIO pin. Push the button a seconnd time, and the circuit disconnect (we stop sending input signals to the GPIO pin). Push it a 3rd time, and we're right back to the beginning (sending an input signal), etc.

smeeb
  • 645
  • 3
  • 9
  • 22

1 Answers1

1

Connecting the left to the right will do the bypass that you want, in the sense that it will change this into a "simple" on-off switch. That's the first part of the answer.

Now as to which should be connected to GND and which to GPIO, that depends on whether your signal is high or low. You still seem confused about how inputs work at a very basic level. (I remember your earlier, related post.) You need to decide - and coordinate in both HW and SW - which type of signal you expect when the switch is "on". That means configuring either a pull up or a pull down resistor somewhere. (That somewhere could be the built-in pull-up/down on the Pi.) And then you need to wire accordingly. There are multiple questions here and many, many posts on this subject around.

Brick
  • 1,375
  • 2
  • 14
  • 20