random track number

i would like to send via serial port a command to choose a random track number from my mp3 track list this is my test but it's not working... ;(

trackNumber = random (0,9);

     // play file 00x.mp3 in folder advert01

    Serial.write(0x7E); // start code
    Serial.write(0x07); // data lenght
    Serial.write(0xA0); // operate code
    Serial.write(0x30); // folder 0
    Serial.write(0x31); // folder 1
    Serial.write(0x30); // track 0
    Serial.write(0x30); // track 0
    Serial.write(0x3(trackNumber)); // track random
    Serial.write(0x7E); // end

0x30 + trackNumber

You're only generating numbers 0 to 8

That may or may not be what you want

BTW we usually say something isn't working when it is at least compiling.

AWOL: 0x30 + trackNumber

You're only generating numbers 0 to 8

That may or may not be what you want

BTW we usually say something isn't working when it is at least compiling.

thanks it works now :)