From 56b0d66022188df2ad3db5a440881085fe540f3a Mon Sep 17 00:00:00 2001 From: SPiNNiX Date: Sat, 27 Jun 2020 19:53:26 +0200 Subject: [PATCH] [+] Guide BTN --- gpiopad.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gpiopad.py b/gpiopad.py index cbfbe1d..8ca60ac 100644 --- a/gpiopad.py +++ b/gpiopad.py @@ -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)