Howdy y'all!
I'm working on a project that I thought would be pretty plug and play, but I'm having a lot of trouble getting it off of the ground. The basic idea is that I want to voice command an arduino board to tell an mp3 player to play a specific track.
For this project I am using the Arduino Nano Every, SpeakUp Click, and DFPlayerMini. See rough wiring guide below
I'm relatively weak at coding, and haven't done an Arduino project in about 4 years, but thought I did an alright job researching and setting up communications between these devices. Below is the code I'm running.
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
//software serial only supports 1 false I/O at a time. I can use the real Rx, Tx along with the software serial to keep this thing schmovin
SoftwareSerial MiniPlayer(11, 12); // RX, TX | Defining which pins are receipt and transmit for the DFPlayer
DFRobotDFPlayerMini VoiceOut; //Giving a variable name for DFRobotDFPlayerMini library to work through
char incomingByte; // Defining the first byte received from SpeakUp Click
char incomingByte1; // Our boy SpeakUp sends 2 bytes, we only want to process one fully so we have this separator
void setup(){
MiniPlayer.begin(9600); //begin read/write for the software serial connected to the DFPlayer
Serial.begin(9600); //begin read/write for the hardware serial connected to the SpeakUp Click
//Just a little config section for the DFPlayer
VoiceOut.volume(20); //Set volume value. From 0 to 30
//----Set different EQ----
VoiceOut.EQ(DFPLAYER_EQ_NORMAL);
// VoiceOut.EQ(DFPLAYER_EQ_POP);
// VoiceOut.EQ(DFPLAYER_EQ_ROCK);
// VoiceOut.EQ(DFPLAYER_EQ_JAZZ);
// VoiceOut.EQ(DFPLAYER_EQ_CLASSIC);
// VoiceOut.EQ(DFPLAYER_EQ_BASS);
VoiceOut.outputDevice(DFPLAYER_DEVICE_SD);
Serial.println("ready for commands");
}
void loop() {
/////
if (Serial.available() > 1) {
// read the incoming byte:
incomingByte = Serial.read();
incomingByte1 = Serial.read();
Serial.print ("Received data = ");
Serial.print(int(incomingByte) ,HEX);
Serial.println(int(incomingByte1) ,HEX);
if (incomingByte == 0){ // First MP3
Serial.println ("Command: MP3 1 "); //only here for debuggin
VoiceOut.play(1); //Play the first mp3
}
From this code I receive literally no output, not even the println of "ready for command." All I receive is a backwards question mark. No change of or updating of anything in the output menu when I speak to the SpeakUp Click, and I'm frankly really lost here. Any help would be greatly appreciated!