-
1Step 1
Make the button activate the Raspberry Pi
I haven't found a perfect solution for this where i can turn on the raspberry pi and soft-shut it off with 1 momentary switch. Right now i have connected the switch to the reset points on the RPi, so it will turn on when it is shutdown and it will shutdown (but not softly) when it is turned on.
-
2Step 2
Make the LEDS light up on boot
I connected a transistor to GPIO4 which turns on the LEDS when it's base is LOW. When the RPi is powered but halted, the LEDS will be off. When the RPi is powered and booting, the LEDS will be on.
First, edit rc.local file :
sudo nano /etc/rc.local
Add the following :
python /home/pi/MYSCRIPT.py &Make custom script to set GPIO4 to LOW :
sudo nano /home/pi/MYSCRIPT.py
Add the following :
#!usr/bin/python
import RPi.GPIO as GPIO
from time import sleep#USE GPIO NUMBERS INSTEAD OF PIN NUMBERS
GPIO.setmode(GPIO.BCM)#SET PIN 4 AS OUTPUT
GPIO.setup(4, GPIO.OUT)#SET PIN 4 TO LOW
GPIO.output(4, 0)I think you also have to change the permissions (not really sure, but it doesn't hurt to do it i guess) :
sudo chmod +x /home/pi/MYSCRIPT.py -
3Step 3
Setup PS3 controller
I'm not gonna explain this because i'm really not sure how i got it working, just like anyone else who tries to connect PS3 controllers to a RPi3. But, once it works, it works.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.