Hi, I bought the case SUPER KUMA 9000, which resembles SNES with functional ON/OFF and RESET buttons using GPIO and activated with a script.
Buttons work fine after running the script, however I'm not able to make the LED stay on. It turns on while starting the PI, but after Batocera starts, the led turns off.
I tried this script in RECALBOX and works well, so I'm thinking that maybe the issue is related with PIN numberings.
Does anyone know if the GPIO PIN have different numbers in RECALBOX and BATOCERA?
As a reference, this is the script provided that works on RECALBOX:
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD) #Use the same layout as the pins
LED=7
FAN=8
RESET=3
POWER=5
CHECK_PCB=10
GPIO.setup(LED, GPIO.OUT) #LED Output
GPIO.setup(POWER, GPIO.IN) #set pin as input
GPIO.setup(RESET, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(CHECK_PCB, GPIO.IN, pull_up_down=GPIO.PUD_UP)
def led(status):
if status == 0:
GPIO.output(LED, GPIO.LOW)
if status == 1:
GPIO.output(LED, GPIO.HIGH)
led(1)
while True:
if GPIO.input(CHECK_PC😎==GPIO.LOW:
led(1)
if(GPIO.input(POWER) == GPIO.HIGH):
led(0)
os.system("shutdown -h now")
if(GPIO.input(RESET) == GPIO.LOW):
led(0)
os.system("reboot")