Adafruit Audio FX Mini Sound Board - Direct Arduino UART Control Blocking Issues

I have an Adafruit Audio FX Mini Sound Board - WAV/OGG Trigger - 2MB Flash set up to run via UART with an Arduino Pro Mini. UG is grounded, and RX/TX are both going to the appropriate pins on the Pro Mini. As far as hardware is concerned, everything is the way it should be. The Pro Mini successfully sends commands to the FX board to play sound and adjust the volume, per the limited information available from Adafruit.

Intent: Code on Pro Mini that has a loop for an LED animation while a sound is triggered, with the purpose that the entire animation plays out for the duration of the sound.

Reality: First step of animation occurs and hangs while entire sound is played, then when the loop repeats, the second step of the animation occurs and hangs while the sound plays a second time, etc.

The Adafruit library would appear to be written in such a way that the MCU is instructed to wait for confirmation that the FX board was successful in finding and playing an audio track, effectively blocking the code on the Pro Mini.

I've tried to alter the library, but have been unsuccessful, and Adafruit's "technical support" is become laughable at best. Does anyone have any suggestions how to edit the library to eliminate the blocking aspect of the default library code?

Sharing your code with us might help to shine some light on the problem.

1 Like

Get rid of the Delay() and replace it with non blocking code.

Do you mean the instances of delay() in the library?

No, the only delays in the library are in the reset function.

If you run the menucommands example, can you query the board with the 't' or 's' command or change the volume while a track is playing? If yes, the library is non-blocking and I don't see a reason why you would have the observed behaviour and my conclusion is that the issue is in your code.

I suspect that the blocking action is your animation not in the library.

Can you post a link to your question on the Adafruit forum so we can see what you have been told already, along with your code and a schematic.

Apparently the Adafruit "technical support" is wrong about the library blocking.

I added a simple if() function to the play command and it fixed everything.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.