07-14-2019, 07:29 PM
(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][/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.)