I have a Keybow MINI hooked up to a Raspberry Pi Zero W, and I’m using Python to respond to events. I have one button that kicks off playing a song on a passive buzzer, and I’m wondering if there’s a way to have a button press stop the song before it completes.

  • TheButtonJustSpins@infosec.pubOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    7 months ago

    Okay, I’ve got it offloaded to a different process and I can cancel that process now. However, is there anything I need to do to let it access GPIO? It looks like it’s working but nothing is coming out of the passive buzzer when I’m playing it off the other process.

    EDIT: I think I got it with threading. Thanks!

    • Vector@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      Great to hear you got it sorted! May I ask out of curiosity which library you are using to play sounds?