I am using DFPlayer Mini with this library: GitHub - PowerBroker2/DFPlayerMini_Fast: Fast and easy to understand Arduino library to use the DFPlayer Mini MP3 module from DFRobot.com. This is a huge improvement (both in terms of execution speed and simplicity) to the standard library provided by DFRobot.com.
I am trying to get a sound to play from the DFPlayer WHILE a button is held down and then stop playing when the button is released.
I have tried various ways with IF statements, While loops etc but I'm not getting anywhere fast.
Everything I try falls foul of the play() function blocking or holding up everything else until play is complete and I don't know how to get around it.
I am building a sound board for a friend and I need three different button actions.
- Momentary Push and Release (MP3 plays until the end of the track) - WORKS
- Push and Hold (MP3 plays while the button is held and stop when released) - NOT WORKING
- Hold and Release (One MP3 plays on button hold and another plays on release) - NOT WORKING
Any help greatly received.
I've been trying for days.