Tiddlemouse / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Ardunio Mega and Sparkfun MP3trigger #1145

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have an Arduino Mega tethered to a Sparkfun MP3player an am trying to get a 
simple routine to run.  

The sketch uploads and the program does a partial execution, where it randomly 
selects a file on the SD instead of what is directed in the code.  With the 
next upload with no updates a new random file is played from the SD and only on 
file is played. After 4 tries no files are played after uploads from the IDE.  
Power cycle does something to clear a condition on the Mega and a sketch 
upload, I guess, is seen as a fresh build, and again plays a random mp3 file 
instead of the directed from the list.  Is it the Mega doing this or is it the 
Sparkfun MP3trigger, idk.
Here is the sketch:
#include <SdFat.h>

#include <MP3Trigger.h>

MP3Trigger trigger;

void setup() {

  Serial.begin(38400);
}

void loop() {

  trigger.update();

Serial.write('t');
    Serial.write(003);
    Serial.print("\nThis is track003");
    delay(5000);

Serial.write('t');
    Serial.write(007); 
    Serial.print("\nThis is track007");    
    delay(5000);

Serial.write('t');
    Serial.write(010);
    Serial.print("\nThis is track010");    
    delay(5000);

Serial.write('t');
    Serial.write(012);
    Serial.print("\nThis is track012");    
    delay(5000);

Serial.write('t');
    Serial.write(015);  
    Serial.print("\nThis is track015");    
    delay(5000);

Serial.write('t');
    Serial.write(17);
    Serial.print("\nThis is track017");    
    delay(5000);
}

Original issue reported on code.google.com by kevinbai...@gmail.com on 28 Nov 2014 at 3:46