Raspily
Posts: 2
Joined: Wed Feb 13, 2019 7:51 am

Usage of Pi touch display and power button

Wed Feb 13, 2019 8:08 am

Hi everybody,

I hope that I picked the right forum for my question. Please feel free to move my post otherwise.

I would like to use a 7“ touch display and a power button at the same time. I was thinking of something like this:
https://howchoo.com/g/mwnlytk3zmm/how-t ... spberry-pi

The Raspberry Pi touch display uses the the SCL pin 5:
https://thepihut.com/blogs/raspberry-pi ... mbly-guide

Is it possible to share this pin for both usages? Is there another solution to solve this?

Thanks and Regards,

Raspily

User avatar
procount
Posts: 1928
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Usage of Pi touch display and power button

Wed Feb 13, 2019 9:46 am

It would be much better to change the GPIO pin for the shutdown button to one that isn't used.
The touchscreen uses SCL as a clock to transfer data from the touchscreen to the Pi. So it is waggling up and down quite a lot.
The shutdown button script is using that pin as an interrupt to detect any falling edge on that pin to cause it to shutdown the Pi. Do you see a problem there? It will be shutting down all the time.
Just chose another pin that isn't used and adapt the shutdown script accordingly.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

SteveSpencer
Posts: 351
Joined: Thu Mar 28, 2013 9:19 am
Location: Nottingham, UK

Re: Usage of Pi touch display and power button

Wed Feb 13, 2019 9:52 am

I just read the first article the OP referred to. It uses GPIO3 specifically because grounding that will wake the Pi from a "halted" state.
However, I would suggest using TWO buttons, a GREEN button between GPIO3 and Gnd, and then pick an otherwise unused exposed GPIO for the shutdown function, on a RED button. (RED=Stop, GREEN=Go - although I'm colour-blind, what do I know).
Steve S
No, I can't think of anything funny that won't offend someone if they want it to...

Raspily
Posts: 2
Joined: Wed Feb 13, 2019 7:51 am

Re: Usage of Pi touch display and power button

Wed Feb 13, 2019 10:24 am

Thanks for your feedback. I really appreciate it.
Would it be possible to use one button and connect it to GPIO 3 for startup and a different GPIO for shutdown? Similar to this:
https://volumio.org/forum/power-off-but ... 60-10.html

Thank you

Return to “General discussion”