Change values inside serial.printf (SSC-32U+Uno)

I'm using a robotic arm with SSC-32U (lynxmotion) and arduino uno. I'm trying to control all servos, which I did it, using serial print: Serial.println("#1 P1700 T2000");

However I want to be able to change the values inside println which I not be able to do so.

Any ideas how to change the string? For example, read a sensor value and put the value right next to P? (Position)

Thanks very much for your help!


Any ideas how to change the string?

1 - Use the sprintf() function to combine the text and variables in a string (lowercase s) then Serial.print() the string
2 - output the elements of the command one after another with separate Serial.print()s. If the receiving device is expecting ASCII values then you will need to convert the numbers to strings (lowercase s) using the itoa() function before sending them.