Raspberry Pi combined reboot/shutdown button demo

NB: this version doesn’t actually do the rebooting or shutting down: it’s a demo. This one does, though …

Here’s how you might have just one button being a reset button (hold down for two seconds) or a shutdown button (hold down for five):

2 thoughts on “Raspberry Pi combined reboot/shutdown button demo”

  1. Good stuff, Russel. Was making a shutdown button for my OSMC Raspberry Pi based on the article in MagPie57. Then, it occurred to me that it would be great to have one button rather than separate shutdown and reset buttons as mentioned there. After dabbling for a while (and learning lots about the GPIOzero library), I came across your post. The hold_repeat option was the bit that I was missing.
    Now it all works beautifully.
    Remark regarding systemd: I appended the /etc/rc.local file to start up the little program at boot. Seems to work just fine. Any thoughts on systemd vs. rc.local?
    Cheers

Leave a Reply

Your email address will not be published. Required fields are marked *