Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15598

My Code Doesnt Work Anymore To Output Music From SD Card Module On Arduino Mega (TMRPCM Library Doesnt Work Properly)

$
0
0

Hi I have a problem with my code because in my previous project my arduino mega could make a sound but after I tried again in the near future it turned out that the sound could not come out. but when I used the default arduino example program the idea for the simple tone turned out to work. does anyone have a solution? Note: "The Code Work Properly On UNO"

#include "SD.h"
#define SD_ChipSelectPin 53
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

 
void setup(void) {
tmrpcm.speakerPin = 8;
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD fail");
return;
}
tmrpcm.setVolume(5);
Serial.println("Play Music");
tmrpcm.play("dona.wav");
Serial.println("Loop Music");
}
  // We'll send debugging information via the Serial monitor

 
void loop(void) {

}

11 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15598

Latest Images

Trending Articles



Latest Images