[+] Guide BTN

This commit is contained in:
SPiNNiX 2020-06-27 19:53:26 +02:00
parent 457470fe52
commit 56b0d66022

View file

@ -80,13 +80,12 @@ while True:
if p1_select and GPIO.input(P1_BTN_SELECT): # select button released
p1_select = False
device_p1.emit(uinput.BTN_SELECT, 0)
# if (not p1_mode) and (not GPIO.input(P1_BTN_MODE)): # select button pressed
# p1_mode = True
# device_p1.emit(uinput.BTN_MODE, 0)
# if p1_mode and GPIO.input(P1_BTN_SELECT): # select button released
# p1_mode = False
# device_p1.emit(uinput.BTN_MODE, 1)
# Later implementation
if (not p1_mode) and (not GPIO.input(P1_BTN_MODE)): # guide button pressed
p1_mode = True
device_p1.emit(uinput.BTN_MODE, 1)
if p1_mode and GPIO.input(P1_BTN_MODE): # guide button released
p1_mode = False
device_p1.emit(uinput.BTN_MODE, 0)
if (not p1_fire1) and (not GPIO.input(P1_BTN_FIRE1)): # Fire1 button pressed
p1_fire1 = True
device_p1.emit(uinput.BTN_SOUTH, 1)