Thank you for your donation!

Instruction Guide Use hardware momentary switches to control moOde
(03-27-2019, 08:53 AM)remy1961 Wrote:
(03-26-2019, 11:41 PM)DRONE7 Wrote:
Quote:On the hardware side, you set your hardware button to connect the ground pin of your RPi with a GPIO pin of your choice.
So you should be able to strip the ends of a couple of dupont cables, connect the plug ends to ground and selected pin then briefly touch the bare ends together. 
Happy to test it here...

Hi. As explained here it actually depends on the "default pull status" of the GPIO: if the default pull status is low, you connect the gpio to the 3.3 volts pin (never connect with the 5 volts pin). If the default status is high, you connect to the ground. 
[Image: 2uypzex.jpg]

I have a question if we set the "default pull status" of the GPIO, can we change the  way we connect GPIO?

I set like this:

#code to manage BUTTONS
GPIO.setup(SW_PREV,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_NEXT,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_PLAY,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_VOLUP,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_VOLDOWN,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_RON,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(SW_RPT,GPIO.IN, pull_up_down=GPIO.PUD_UP)

and then I connect the GPIO as the default status are "High", and the buttons work in proper.

Messages In This Thread
RE: Use hardware momentary switches to control moOde - by cyoops - 03-27-2019, 02:01 PM

Forum Jump: