serial.writeByte, send codes to a servos control board

hi?

i have a servos control board,
its send codes like this

  
#1 P1500 T1000 \r  

1 is for servo id
p1500 is for servo postion
t1000 is for servo speed

and i try like this .

  
  
     serial.writeByte('#');  
     serial.writeByte(1);  
     serial.writeByte('P');  
     serial.writeByte(1500);  
     serial.writeByte('T');  
     serial.writeByte(1000);  
     serial.writeByte('\r');  
   

and this

  
  
    unsigned char buffer[6];  
    buffer[0] = '#';  
    buffer[1] = 0;  
    buffer[2] = 'P';  
    buffer[3] = 1000;  
    buffer[4] = 'T';  
    buffer[5] = 1000;  
    buffer[6] = '\r';  
    serial.writeBytes(buffer, 7);  
   

but didn’t work,
anyone can please help me,thanks!!!