Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Use hardware momentary switches to control moOde
#36
(07-09-2019, 07:07 AM)remy1961 Wrote:
(05-20-2019, 11:27 AM)fedormil Wrote: Hello!
For use one button power on/off this
[img][Image: 08e97fa6a57f097a6c6b697fd8908c71.png][/img]
Use pnp transistor

Hi. You don't need to install a particular script for this to work?
Remy

Hi, I use standart script for button, only just added 2 lines:

Code:
GPIO.setup(16, GPIO.OUT)
GPIO.output (16, GPIO.HIGH)

It uses the principle of blocking voltage. When the script is running, the transistor is closed, and the button starts the shutdown or reboot command. When MK is turned off, the script stops and the transistor opens. When you press a button, the ground closes on contact P6, and the raspberry wakes up.
Pins can be used any.)
Reply


Messages In This Thread
RE: Use hardware momentary switches to control moOde - by fedormil - 07-14-2019, 07:29 PM

Forum Jump: