I am working on a project where I would like to turn a potentiometer on one arduino, and receive the RGB information on a second through bluetooth.
Since the PWM would work off of 0-255 integers I need to transmit the current value in 255255255 format. The state is sent through serial and then captured and stored in an Array on the LED arduino. So when transmitting I need to send in the full three digit count across the serial line. If I were only using the blue led, the counts would be 0,0,255, but i need to convert the 0's to 000000255, or 10,10,255 to 010010255, etc.
Or look at sprintf and the %d format specifier - in this case %03d. Sprintf is going to be more expensive in terms of flash consumed if this is all you use it for though.