Soundboard UART Mode on Mega doesn't work

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
catsareawesome
 
Posts: 3
Joined: Sat Mar 07, 2015 4:43 pm

Soundboard UART Mode on Mega doesn't work

Post by catsareawesome »

Soundboard work perfectly with Uno and in GPIO mode . I need to use more digital pins so i switched to Mega . Having trouble getting soundboard to work with Mega. i switched the TX and RX pins like some other post suggested and nothing happens.

Soundboard = Mega
ACT = D50
TX = D18
RX = D19
RST = D11
L = Amp input +
GND = Amp input -
UG = looped to GND
VIN = 5V on Mega
GND = GND on Mega

Code: Select all

// soundboard pins and setup
#define SFX_RST 11 
#define SFX_RX 19 
#define SFX_TX 18 
const int ACT = 50;    // this allows us to know if the audio is playing
SoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX); 
Adafruit_Soundboard sfx = Adafruit_Soundboard(&Serial1, NULL, SFX_RST);
Serial1.begin(9600); 

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Soundboard UART Mode on Mega doesn't work

Post by adafruit_support_mike »

Try using one of the Mega's hardware Serial ports instead of a SoftwareSerial connection.

SoftwareSerial is a work-around for the Uno, whose only hardware UART is connected to the USB-to-Serial converter that talks to the computer. Hardware Serial is almost always better and more reliable if you have the option.

User avatar
catsareawesome
 
Posts: 3
Joined: Sat Mar 07, 2015 4:43 pm

Re: Soundboard UART Mode on Mega doesn't work

Post by catsareawesome »

adafruit_support_mike wrote:Try using one of the Mega's hardware Serial ports instead of a SoftwareSerial connection.
the soundboard is connected to Mega serial D17 and D18. Do you mean the library used?. I didnt find any hardware serial library .

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Soundboard UART Mode on Mega doesn't work

Post by adafruit_support_mike »

There is no hardware Serial library. The Arduino environment for the Mega gives you multiple Serial interfaces automatically. The pins labeled TX1 and RX1 are identified in code as Serial1, TX2/RX2 are Serail2, and so on.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”