Go Down

Topic: Adafruit sound Fx mini board 2MB not playing sounds in UART mode with Arduino Un (Read 66 times) previous topic - next topic


So I'm currently building a project for my major project. I'm using Arduino UNO as the microcontroller.

The project is using an Infrared remote to trigger cases within the program. As part of these cases, I want the Arduino to play specific tracks that I have saved as .WAV files onto the soundboard. In addition to this, a vibrator motor and an LCd screen will also perform various functions.

I have wired up my Sound FX board and amplifier as shown in the link below
https://learn.adafruit.com/adafruit-aud ... io-control

I have however connected the RX pin to pin 6 on the UNO, RST to pin 8 and TX to pin 7.

I have tried to trigger the tracks playing simply by using the sfx.playTrack(" "); command but nothing seems to occur.

As you can see from the image attached, when I press the appropriate button, the serial plotter is stating that the correct track sound file is being triggered, as well as the related IR key code. But the board just isnt playing.

I have named my files T01RAND1.WAV, T02.WAV and T03.WAV. They are to be played in cases second_key , fourth_key and fifth_key.

If anyone could please tell me where I'm going wrong or if there's a line of code I'm missing I would really appreciate it. Ive spent all day trying to figure it out and I've sadly made no progress.

Below is my full sketch:

#include "IRremote.h"
#include <IRremoteInt.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include "Adafruit_Soundboard.h"

int receiver_pin = 13;

int haptic_feedback = 10;
int second_led_pin = 9;
int third_led_pin = 8;
int fourth_led_pin = 7;
int led[] = {0,0,0,0,0};
IRrecv receiver(receiver_pin);
decode_results output;

#define first_key 16724175
#define second_key 16718055
#define third_key 16743045
#define fourth_key 16716015
#define fifth_key 16726215
#define sixth_key 16734885

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

// Choose any two pins that can be used with SoftwareSerial to RX & TX
#define SFX_TX 7
#define SFX_RX 6
// Connect to the RST pin on the Sound Board
#define SFX_RST 8
// You can also monitor the ACT pin for when audio is playing!

// we'll be using software serial
SoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);
// pass the software serial to Adafruit_soundboard, the second
// argument is the debug port (not used really) and the third
// arg is the reset pin
//Adafruit_Soundboard sfx = Adafruit_Soundboard(&ss, NULL, SFX_RST);
// can also try hardware serial with
Adafruit_Soundboard sfx = Adafruit_Soundboard(&Serial, NULL, SFX_RST);

void setup()
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Welcome to");
lcd.setCursor(0, 1);

pinMode(haptic_feedback, OUTPUT);
pinMode(second_led_pin, OUTPUT);
pinMode(third_led_pin, OUTPUT);
pinMode(fourth_led_pin, OUTPUT);
pinMode(SFX_RX, OUTPUT);
pinMode(SFX_TX, OUTPUT);

void loop() {
if (receiver.decode(&output)) {
unsigned int value = output.value;
switch(value) {

case first_key: // vibrate
if(led[1] == 1) {
digitalWrite(haptic_feedback, LOW);
led[1] = 0;
} else {
digitalWrite(haptic_feedback, HIGH);
led[1] = 1;

case second_key: // Bad technique audio, lcd and vibrate

digitalWrite(haptic_feedback, HIGH);
digitalWrite(second_led_pin, HIGH);
led[2] = 1;
lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Back is Arched!");
lcd.setCursor(0, 1);
lcd.print("Please Correct");
digitalWrite(second_led_pin, LOW);
digitalWrite(haptic_feedback, LOW);
led[2] = 0;

case third_key: // good technique on lcd

lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Great Technique!");
lcd.setCursor(0, 1);
lcd.print("Keep Going!");

case fourth_key: // Post workout tip - well done message

sfx.playTrack("T03 ");
lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Well Done! 87%");
lcd.setCursor(0, 1);
lcd.print("Correct Techniqu");

case fifth_key: // pre workout technique tip and vibration

digitalWrite(haptic_feedback, HIGH);
sfx.playTrack("T02 ");
lcd.setCursor(0, 0); // set the cursor to column 0, line 0
lcd.print("Brace your core&");
lcd.setCursor(0, 1);
lcd.print("flatten the back");
digitalWrite(haptic_feedback, LOW);


Go Up