buzzer_music
buzzer_music copied to clipboard
Buzzer randomly does not stop buzzing
I'm playing a song on game win using an active piezo buzzer on a Raspberry Pi Pico. Mostly it works fine. Randomly it seems to "freeze" and leave the buzzer on. Power cycling stops the noise.
Code logic is song = '0 E5 3 14;3 .....' mySong = music(song, pins=[Pin(15)]) for i in range(len(song)): mySong.tick() time.sleep(0.04) mySong.stop() buzzer.off() time.sleep(1.0) lcd.clear() lcd.putstr('Press Start')
Any ideas? I added the extra buzzer.off() to further try to shut it down (buzzer is Pin 15) though the stop() call ought to take care of that.