Modify Hex file to add a logo to the thermal printer receipt

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

Re: Modify Hex file to add a logo to the thermal printer rec

Postby ric » Sun Nov 08, 2020 10:43 am

I guess you will need to write a program to read the data and reformat it into the required format using multiple characters.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: Modify Hex file to add a logo to the thermal printer rec

Postby AlexAler » Sun Nov 08, 2020 10:53 am

Ric, I am not sure how that program should be? Can you give me some hints?
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

Re: Modify Hex file to add a logo to the thermal printer rec

Postby ric » Sun Nov 08, 2020 11:01 am

Do you have any programming skills at all?
This sounds like a first year programming exercise, which could be done in any language you like.
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: Modify Hex file to add a logo to the thermal printer rec

Postby AlexAler » Sun Nov 08, 2020 1:09 pm

My programming is not bad. I tried to break my logo to 16 characters, e.g., {0x00, 0x01,..,0x13}. My problem is when I write a code like this:

Code: Select all
   print(0x00);
   print(0x01);
   print(0x02);
   print(0x03);
delay_ms(1000);
beez_time=BEEP;
   print(13);//go to new line
   print(0x04);
   print(0x05);
   print(0x06);
   print(0x07);
delay_ms(1000);
beez_time=BEEP;
   print(13);
   print(0x08);
   print(0x09);
   print(0x0A);
   print(0x0B);
delay_ms(1000);
beez_time=BEEP;
   print(13);//go to new line
   print(0x0C);
   print(0x0D);
   print(0x0E);
   print(0x0F);
delay_ms(1000);
beez_time=BEEP;
   print(13);//go to new line
   print(0x10);
   print(0x11);
   print(0x12);
   print(0x13);
delay_ms(1000);
beez_time=BEEP;
   print(13);//go to new line
   print(0x14);
   print(0x15);
   print(0x16);
   print(0x17);
delay_ms(1000);
beez_time=BEEP;
   print(13);//go to new line



where these hex addresses represents (in the micro thermal printer)
Code: Select all

       /*0x01*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x83, 0xbf}},

/*0x02*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0xff, 0xff, 0x81, 0xbf, 0xff, 0xff, 0xff, 0xff, 0x80, 0xbf, 0xff, 0xff, 0xff, 0xff }},

/*0x03*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xc0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff}},

/*0x04*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xbf}},

/*0x05*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0xff, 0xff, 0xdf, 0x83, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xef }},

/*0x06*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0x1f, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xef, 0xff, 0xff, 0xf3, 0xff }},

/*0x07*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0xff, 0xbf, 0xfe, 0xf9, 0xff, 0xff, 0xcf, 0x8f, 0xf0, 0xfc, 0xff, 0xfe, 0x7f, 0x01, 0xc2}},

/*0x08/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0x7e, 0x7f, 0xff, 0x7f, 0x70, 0x87, 0x7f, 0x7f, 0xfc, 0xff, 0x7e, 0x9f, 0x3f, 0xbf, 0xff, 0xfe}},

/*0x09*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0x7e, 0x3f, 0x3f, 0xdf, 0xfb, 0xfe, 0x7e, 0x3f, 0x9f, 0xdf, 0xff, 0xfe, 0xfc, 0x9f, 0x9f, 0xef}},

/*0x0A*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xfb, 0xfe, 0xf8, 0xcf, 0x9f, 0xef, 0xff, 0xf0, 0x09, 0xe0, 0x07, 0xf7, 0xf7, 0xe0, 0x03, 0xe0}},

/*0x0b*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0x00, 0xf7, 0xff, 0x0c, 0xfb, 0xf7, 0x98, 0x37, 0xfc, 0x3e, 0xff, 0xff, 0xbf, 0x3b, 0xfe, 0x7e }},

/*0x0c*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0x7f, 0xbf, 0x3b, 0xfe, 0x7e, 0xff, 0xff, 0x9f, 0x3b, 0xff, 0x7e, 0xfd, 0xff, 0x9f, 0x3b}},

/*0x0d*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0x3e, 0x7f, 0xfd, 0x9e, 0x7d, 0xdf, 0xbc, 0xfd, 0xf1, 0x8f, 0x7d, 0xdf, 0xb9, 0xff, 0xff }},

/*0x0e*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xe6, 0x7d, 0xff, 0x83, 0xe3, 0x77, 0xf0, 0xfd, 0xff, 0xc7, 0xff, 0xe7, 0xf9, 0xfd, 0xff, 0xc3 }},

/*0x0f*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xff, 0x5f, 0xf0, 0xfd, 0xff, 0xc1, 0xff, 0xbf, 0xe6, 0xfd, 0xcf, 0x98, 0xed, 0x6f, 0xce, 0x7d }},

/*0x10*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0xef, 0x9e, 0x7f, 0xf7, 0x1e, 0x7b, 0xef, 0x9f, 0x7f, 0xc7, 0xbf, 0x3b, 0xff, 0x3f, 0x7d, 0xff }},

/*0x11*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
        {0x9f, 0x3b, 0xef, 0x3f, 0x77, 0xff, 0x9f, 0xbb, 0xfb, 0x7f, 0x7f, 0xff, 0x9f, 0x17, 0xf6, 0x3f }},

/*0x12*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//POINTING RIGHT(ALT+16)
        {0x7b, 0xf0, 0x1c, 0x77, 0xff, 0x86, 0x01, 0xe0, 0x00, 0xf7, 0xfb, 0xf0, 0x0c, 0xef, 0x83, 0xef}},

/*0x13*/{{0x00, 0x00, 0x00, 0x00,    0x00,    0x00,    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//POINTING DOWN(ALT+31)
        {0xf3, 0xf9, 0x7c, 0x4f, 0xdf, 0xef, 0xfd, 0xff, 0x7e, 0x1f, 0x9f, 0xdf, 0xfe, 0x7f, 0x7f, 0x3f }},

/*0x14*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//>
        {0x9f, 0xdf, 0xfc, 0xff, 0x3f, 0x1f, 0xbf, 0xbf, 0xfe, 0xff, 0xbf, 0x07, 0x3f, 0x7f, 0xff, 0xff }},

/*0x15*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    0x00,    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//<
        {0x98, 0x43, 0x3e, 0x7f, 0xff, 0xcf, 0x90, 0xf8, 0x7c, 0xff, 0xff, 0xff, 0xc3, 0xfe, 0x79, 0xff }},

/*0x16*/{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},//=
        {0xff, 0xdf, 0xdf, 0xff, 0x73, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff }},

/*0x17*/{{0x00,    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    0x00, 0x00},//)
        {0x9f, 0xff, 0xff, 0xfe, 0x7f, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0x5f, 0x83, 0xff, 0xff, 0xff, 0xff }},




I saw the attached LOGO!, which is quite puzzling. Another image is my logo.

Can anyone tell me what is going on? BTW, I converted my logo to hex files by https://javl.github.io/image2cpp/.
Attachments
download (46).png
My LOGO
download (46).png (846 Bytes) Viewed 1758 times
2.png
The printed LOGO!
2.png (156.39 KiB) Viewed 1758 times
AlexAler
 
Posts: 7
Joined: Sun Nov 01, 2020 9:37 am

Previous

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 10 guests

cron