Problem adjusting code to work with Arduino 1.0

Below is older code I used to instruct a mp3 player to play and stop successfully.

void setup() {                
  Serial.begin(9600);
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
         
  Serial.print(02,BYTE); // Command byte
  Serial.print(160,BYTE); // Command byte - mp3 player PLAY
  
  delay(5000);              // wait for five second

  digitalWrite(13, LOW);    // set the LED off

  Serial.print(02,BYTE); // Command byte
  Serial.print(162,BYTE); // Command byte - mp3 player STOP
  
  delay(5000);              // wait for five second
}

I have attempted to modify the code to work with Arduino 1.0, but I have been unsuccessful to get it to work with the mp3 player.

void setup() {                
  Serial.begin(9600);
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
         
  Serial.write(02); // Command byte
  Serial.write(160); // Command byte - mp3 player PLAY
  
  delay(5000);              // wait for five second

  digitalWrite(13, LOW);    // set the LED off

  Serial.write(02); // Command byte
  Serial.write(162); // Command byte - mp3 player STOP
  
  delay(5000);              // wait for five second
}

Thank you for any feedback!

change Serial.print(value, BYTE) to Serial.write(value).

I have already attempted that solution, (see above) but it does not work.

I have verified that the mp3 player works with code compiled and downloaded before Arduino 1.0.

I would like to get this to work with Arduino 1.0. I might need to use a scope and attempt to figure out what is happening different with Arduino 1.0.

One thing to keep in mind is that literals are interpreted as ints. You want them to be interpreted as bytes. There is now a way to force that, but you can cast the int to a byte.

Serial.write((byte)2);
Serial.write((byte)160);

Serial.write() does different stuff with bytes and ints.

Serial.write() does different stuff with bytes and ints.

That there. An int is 2 bytes. A byte is, of course, 1 byte.

So, Serial.write(160) will output the integer value 160 as two bytes of data.
But you want a single byte of data output, so as Pauls said, cast it to a byte with Serial.write((byte)160) and it will output the byte value 160 as a single byte of data.