Printer problem.

Hello, i have a slight problem. I am trying to use an Arduino 2560 to communicate with a printer my teacher made (ill post a picture later.) The printer needs an ID in hex then the data it should print and of course carriage return. But I am unable to send these numbers to my printer via my Arduino. I have been trying to use the Serial commands but with no luck so far. I will post some code later.

What sort of interface does the printer have ? I would assume serial, but you never know.
What is the required number of data bits, stop bits and parity ?

Why are you unable to send the required ID and data, or do you mean that you have tried and it did not work ?

I don't know what you mean by most of that but ill try to answer you (Yay for second language). There is an IC my teacher programmed himself via Keil, i unfortunately haven't access to this code yet. The id i have to send it is 0x8A.

And yea i've tried to send it with different variations of this code (It isn't pretty but i tried to test as much at once.)

int id = 0x8A;
 int Tekst = 0x41;
 int CR = 0x0D;
void setup() 
{
Serial.begin(1200); // for debug info to serial monitor
 Thermal.begin(1200);
}

void loop()
{

 Thermal.println(id);
 Thermal.println(Tekst);
 Thermal.println(CR);
 Thermal.write(id);
 Thermal.write(Tekst);
 Thermal.write(CR);
 Thermal.println(10);
 Thermal.println(65);
 Thermal.println(12);
 Thermal.println(10,HEX);
 Thermal.println(65,HEX);
 Thermal.println(12,HEX);
 Thermal.write(0x8A);
 Thermal.write(0x41);
 Thermal.write(0x0D);
}

Or this code

 int id = 0x8A;
 int Tekst = 0x41;
 int CR = 0x0D;
void setup() 
{
Serial.begin(1200); // for debug info to serial monitor
 
}

void loop()
{

 Serial.println(id);
 Serial.println(Tekst);
 Serial.println(CR);
 Serial.write(id);
 Serial.write(Tekst);
 Serial.write(CR);
 Serial.println(10);
 Serial.println(65);
 Serial.println(12);
 Serial.println(10,HEX);
 Serial.println(65,HEX);
 Serial.println(12,HEX);
 Serial.write(0x8A);
 Serial.write(0x41);
 Serial.write(0x0D);
}

Don't worry about the language barrier, you are doing fine.

Let's start with something simpler. How is the printer connected to the Arduino ?

NOTE - in future when you post code can you please include the whole program, not just snippet, as it is impossible to see what libraries, of any, that you are using and how the snippet relates to the rest of the code.

One issue you are probably having is that you are using println everywhere. This adds a carriage return + line feed onto the end of each line it outputs. If you are terminating communication with a carriage return this will end the communication immediately after the id is sent

Well I have connected it to pin 1 TX and ground. Here are some pictures of the setup. It should become a prototype for a queue system. Eltek - Album on Imgur

And the code is all i have to my printer ( I have different files for the different examples) but would this code be more likely again i am only testing the printer at the moment and not printing anything substantial.

 int id = 0x8A;
 int Tekst = 0x41;
 int CR = 0x0D;
void setup() 
{
Serial.begin(1200); // for debug info to serial monitor
 
}

void loop()
{
 Serial.write(id);
 Serial.write(Tekst);
 Serial.write(CR);
}

Well i found the mistake my teacher who made the code in Assembler forgot some code that enabled the printer to receive serial.