This project is in SD card loaded stolen melody is provided by command sent from the serial monitor.
If you want to add the application var.siz 6-melody melody melody file must be the same as the name of the specified code name.
The components are used:
Arduino UNO
SD card reader
speakerphone
Step 1: Arduino Code
//pin in sd card input module ** MOSI β pin 11 ** MISO β pin 12** CLK β pin 13** CS β pin 4
#include <SD.h>// SD card library
#define Sd_Chip_pin 4
#include <TMRpcm.h>// playing the melody library
char val;TMRpcm tmrpcm; // Create a melody function
void setup()
{ Serial.begin(9600);
tmrpcm.speakerPin = 9; // 9 pin to attach digital speakers + leg
if (!SD.begin(Sd_Chip_pin)) {
// sd module baΔlanma return; } }
void loop()
{ if (Serial.available())
{ delay(100);
while(Serial.available() > 0)
{ val = Serial.read();
if (val == β1β) { // 1 steal 1.wav file sends data
tmrpcm.play(β1.wavβ);
}
else if(val == β2β)
{ // 2.wav 2 sends data to steal files
tmrpcm.play(β2.wavβ); }
else if(val == β3β)
{ // 3.wav sends data to steal files
tmrpcm.play(β3.wavβ); }
else if(val == β4β)
{ // 4.wav 4 sends data to steal files
tmrpcm.play(β4.wavβ); }
else if(val == β5β)
{ // 5.wav 5 sends data to steal files
tmrpcm.play(β5.wavβ); }
else if(val == β6β){ //6.wav 6 sends data to steal files
tmrpcm.play(β6.wavβ);
}
}
}
}
For More Details: Arduino playing the melody with the Sd card