Using Mega 2560, W5100 Ethernet Shield, SD card and 2 speakers. When I connect 1 speaker, the sound plays fine. However, the speaker has to be in pin 12, pin 11 is just static. When 2 are connected, I hear just static, but static from both speakers. I put one speaker into pin 11 and the other in pin 12, the output.
Edit: english is hard. The correct pin to use was 46-45
#include <SD.h>
#include <SPI.h>
#include <TMRpcm.h>
#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
//#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins
TMRpcm audio; // create an object for use in this sketch
void setup() {
digitalWrite(10,HIGH);
audio.speakerPin = 11; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
pinMode(12,OUTPUT); //Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45
Serial.begin(115200);
if (!SD.begin(SD_ChipSelectPin)) {
return;
}else{
Serial.println("SD OK");
}
audio.volume(100);
audio.play("1.wav");
}
void loop() {
}
I uncommented #define STEREO_OR_16BIT as the library says to do. I left #define buffSize 128 because the library says I shouldn't with a MEGA board. Also, both speakers are connected to their own GND. Also pin 11 is fine, when i set output to 10, 11 alone works fine
Edit, sorry my english is not my strong suit, i thought it meant Mega can use 11 or 46. I just spent alot of time trying to make it work with 11 thinking 11 works with mega fine due to the fact that a single speaker worked fine on it. I will not directly connect the speaker to the arduino anymore. Luckily, none of the pins burnt out yet( i think), thanks for telling me so. I am worried about the sound getting quieter though