escape characters via serial


I'm controlling a serial printer from arduino, now it works perfect but i need to send it escape characters to controll some especific features of the printer. Anybody can show me a way to do that?

i need to send "ESC i"


There are details on how to send data via serial output:

While there are several methods, one would be:

int esc = 27; //ascii escape key . . . . Serial.print(esc, 'i');


You can also embed 27 in a string:

Serial.print("\x1B" "i");

Thanks, works perfect!