I have bought a TTL therma lprinter fro m aliexpress;
https://www.aliexpress.com/item/33024425126.html?spm=a2g0s.9042311.0.0.7ea94c4dILXePm
The printer only writes 4 character.
When I increase for loop over 3 it writes nothing.
for loop <3 it prints ABCD
for loop <4 it prints nothing
====================================
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Epson default printer settings for baud rate
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
//
Serial.write(0x1B); //ESC
Serial.write(0x40); //@
Serial.write(0x12); //Density
Serial.write(0x23);
Serial.write(0x05);
Serial.write(0x1B); // paragraph
Serial.write(0x61);
Serial.write(0x01); //
////////////////////////////
printFromAtoZ()
}
void loop() {
}
void printFromAtoZ()
{
unsigned char caracter = 'A';
Serial.write(0x1B); //ESC POS command
Serial.print('@'); //ESC POS initialize followed after command
for(uint8_t i = 0; i<=3;i++){
Serial.write(caracter++);
}
Serial.write(0xA);
//Print and Line Feed from Buffer
}