reformat, better output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jul 2023 09:03:00 +0000 (11:03 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jul 2023 09:03:00 +0000 (11:03 +0200)
gumb.py

diff --git a/gumb.py b/gumb.py
index d7785cb..4aa8574 100755 (executable)
--- 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"