Hi all, I am trying to print using thermal printer (ESC POS printer) by sending data directly from Arduino mega2560. I use serial1 Arduino mega2560 to send signal to the printer. I have been successfully printing by using this simple code:
void setup(){
Serial1.begin(19200);
}
void loop(){
Serial1.println("hello word");
}
The question is, how do I change the font of the font size?
I have been trying to send ESC command like this: Serial1.print("ESC @") or Serial1.write("ESC @") and the result is just printing that command on the paper.
I found some example that uses something like : Thermal.print(27,BYTE) however for some reason my arduino software is always fail to compile (ERROR: 'BYTE' was not declared in this scope)
Can anyone help me with this problem? Thank you in advance for any suggestions.... cheerss
Just found a sheet containing all the commands for it. You are right, ESC command is flagged with a byte of 27. so do this:
Serial.write( 27 );
You then follow this with the additional information depending on what command you want to set. Also using write instead of print. write sends data in its raw form, print sends the ascii equivalent of any values.
Could you post the webpage regarding the information just now ?
Still struggling as it does not do anything even though I send data using write command T_T
Hi
Please help me out. I am currently using POS 76 II printer that i need to interface with arduino. I used MAX232 in between DB9 and Arduino Mega2560 for level shifting. I need to transfer data from arduino to printer and take print from printer. No reverse communication(from printer to arduino). I am using simple Serial.print("HI"); command to print but nothing happens on printer . Don't know why. Please help me.