From 89f2ea7e9de57e4c8a805d78e5cf0605664c6be2 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 23 Jul 2023 11:03:00 +0200 Subject: [PATCH] reformat, better output --- gumb.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/gumb.py b/gumb.py index d7785cb..4aa8574 100755 --- a/gumb.py +++ b/gumb.py @@ -25,24 +25,25 @@ def main(): if GPIO.input(26): # the button is being pressed, so turn on the green LED # and turn off the red LED - # GPIO.output(24,True) - # GPIO.output(25,False) - print "button false" + # GPIO.output(24,True) + # GPIO.output(25,False) + #print "button false" if odplayao == False: - odplayao = True - pygame.mixer.music.play() - while pygame.mixer.music.get_busy() == True: - continue + odplayao = True + pygame.mixer.music.play() + print('play') + while pygame.mixer.music.get_busy() == True: + continue else: - odplayao = False - # print "button true" + odplayao = False + print "button true" # the button isn't being pressed, so turn off the green LED # and turn on the red LED - # GPIO.output(24,False) - # GPIO.output(25,True) - # print "button false" +# GPIO.output(24,False) +# GPIO.output(25,True) +# print "button false" - time.sleep(0.1) + time.sleep(0.1) print "button pushed" -- 2.20.1