Help with Network Commands
Hello Recalbox team and fans,
I'm having some difficulties understanding how to use the Emulator Actions via GPIO (https://github.com/recalbox/recalbox-os/wiki/Emulator-interactions-via-GPIO-mapping-(EN)) guide.
I have 3 arcade buttons that I would like to map to fast-forward, pause, and reset, respectively. I see the script in the link, but I'm not 100% on how to rebuild it to allow me to use 3 different buttons. What parts of the original script do I need to cut and paste? I would use BCM 17, 27 & 22
original script here:
import RPi.GPIO as GPIO
addressing information of target
IPADDR = "127.0.0.1"
PORTNUM = 55355
enter the data content of the UDP packet
COMMAND = "RESET"
initialize a socket, think of it as a cable
SOCK_DGRAM specifies that this is UDP
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print 'Failed to create socket'
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
s.sendto(COMMAND, (IPADDR, PORTNUM))
GPIO.add_event_detect(3, GPIO.FALLING, callback=exitEmulator, bouncetime=500)
Thank you for the help!