_Arduino + mp3 Trigger



Materials:

1 Arduino Uno
1 MP3 Trigger
1 Micro SD
1 Amplifier
2 Speakers
Cables

Connection



If we charge the Mp3-Trigger with Arduino, remember to set the button of Mp3-Trigger on USB.

State of MP3-Trigger LED:
- 1 long blink, microSD not found, – try to format your card in FAT16.
- 1 long blink, followed by 1 short blink – microSD media found, no MP3 files located.
- Constant short blinks – Hardware problem with MP3 Decoder.
- 3 short blinks – microSD media found, at least 1 MP3 file located.



Code


#include <SoftwareSerial.h>  
#include <MP3Trigger.h>  
 
SoftwareSerial trigSerial = SoftwareSerial(2, 3);
MP3Trigger trigger; // we create the trigger object
 
byte track = 100;   
 
void setup() {
  trigger.setup(&trigSerial);    
  trigSerial.begin( MP3Trigger::serialRate() );
  pinMode(4,OUTPUT);
}
 
void loop() {
  digitalWrite(4,HIGH);   
  delay(1000);
  trigger.trigger(track);
  delay(180000);  // we listen to the music for 3 minuts
 
 
  digitalWrite(4,LOW); // after we stop the music for 10 minuts 
  delay(600000);
}


Video