Go Down

Topic: track counter (Read 1 time) previous topic - next topic

onesky

#5
Sep 24, 2012, 06:33 pm Last Edit: Sep 24, 2012, 06:40 pm by onesky Reason: 1

Do I see a Serial.begin?
Also, indentation. I really like consistent indentation.
in the original code is included, i just pasted the part on topic..

what is not working is this:

   Serial.write(0x30+TrackCounter); // file units

if i use the random option, it works..

Quote
val = digitalRead(buttonPinFire);  // read the pin value and save it
      // control that input is HIGH (button pressed) 
      if (val == HIGH) { 
                // play files random in folder advert08
                 trackNumber = random (0,6);
     Serial.write(0x7E);
    Serial.write(0x07);
    Serial.write(0xA0);
    Serial.write(0x30); // folder tens
    Serial.write(0x38); // folder unit
    Serial.write(0x30); // file hundreds
    Serial.write(0x30); // file tens
    Serial.write(0x30+trackNumber); // file units
    Serial.write(0x7E);
  }
      }

     

this is the mp3 board manual
http://www.elechouse.com/elechouse/images/product/MP3%20WTM-SD%20module/WTM-SD%20moduleV1.08.pdf

PaulS

In one case, you use trackCounter. In the other, you use trackNumber. We can see how trackCounter is defined, but not how trackNumber is.

AWOL

Quote
in the original code is included, i just pasted the part on topic..
which is precisely why we ask you to post all of your code.

0x30 is better written as '0', IMO.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

onesky

#8
Sep 24, 2012, 11:32 pm Last Edit: Sep 24, 2012, 11:57 pm by onesky Reason: 1

In one case, you use trackCounter. In the other, you use trackNumber. We can see how trackCounter is defined, but not how trackNumber is.


they are same

// Variables will change:
int trackNumber = 0;
int TrackCounter = 0;


the code is very very long
if i remove   "TrackCounter++" the first track plays fine but only that one

AWOL

Quote
the code is very very long

So will this thread be unless you post the code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up