Modifications

Sauter à la navigation Sauter à la recherche
137 octets supprimés ,  1 avril 2025 à 15:19
Ligne 69 : Ligne 69 :  
index = 0
 
index = 0
 
while True:
 
while True:
−
     if counter>0: # Button pressed?     
+
     if counter>0:
−
        # Song name to play
   
         song_name = song_names[index]
 
         song_name = song_names[index]
 
         print( 'Ring the bell! %i %s' % (index,song_name) )
 
         print( 'Ring the bell! %i %s' % (index,song_name) )
 
          
 
          
−
        # Play the song
   
         buzzer.play_song( song_name )
 
         buzzer.play_song( song_name )
 
          
 
          
−
        # Select next song
   
         index += 1
 
         index += 1
 
         if index >= len(song_names):
 
         if index >= len(song_names):
 
             index = 0
 
             index = 0
 
          
 
          
−
        # Reset button detection
   
         counter=0
 
         counter=0
  
32 920

modifications

Menu de navigation