Professional Documents
Culture Documents
* Hardware connections:
Interface SD Card Module:
Connect SD Card Module VCC to 5V.
Connect SD Card Module GND to GND.
Connect SD Card Module CS to pin4.
Connect SD Card Module MOSI to pin11.
Connect SD Card Module MISO to pin12.
Connect SD Card Module SCK to pin13.
Speaker:
Use solder to connect two jump wires to the speaker jack.
One wire from the speaker jack will connect to GND.
Another wire frome the speaker jack will connect to pin9.
void setup(){
tmrpcm.speakerPin = 9;
//The sound file "2" will play each time the arduino powers up, or is reset
tmrpcm.play("2.wav");
}
void loop(){
if(Serial.available()){
if(Serial.read() == 'a'){