SD Card Module With Arduino | Arduino Mp3 Player

Circuit Diagram:

Code:

#include <SD.h>                      
//#define SD_ChipSelectPin 53        
#define SD_ChipSelectPin 10          
#include <TMRpcm.h>                  
#include <SPI.h>

TMRpcm tmrpcm;

void setup()
{
tmrpcm.speakerPin=9;          
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
  Serial.println(“SD fail”);
  return;
}
tmrpcm.setVolume(6);
tmrpcm.play(“gun.wav”);

}

void loop()
{

  }

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart