Go Down

Topic: storing graphic on/for thermal printer (Read 945 times) previous topic - next topic

Boffin1

The more I find out the less I know :-(

I have got my Posiflex 6800 Serial  thermal printer running now, using the scraps of information that I can understand from the manufacturer, Ladyada, Sparkfun, and some ESC/POS info from Epsom, and a few postings on our forum. ( thanks )
I have learnt a hell of a lot, but realise theres a long way to go, and I dont have any spare time at all to learn.

So, now I can print the important text -  bigger/smaller/inverted/ justified  etc. -  but now I need some help to get a logo ( 15k   .cpp file ) that I generated as per the instructions on the ladyada mini thermal tutorial , into the eeprom of the printer - unless I make it much smaller and try to save it in the 328 eeprom?

When I tried to run the ladyada sample,  ( I had made a seperate tab , and saved the file there as suggested , but when I try to run my sketch, it says progmem has not been defined , so I tried including   #include <avr/pgmspace.h>  but still no luck.

I have a feeling I am trying all sorts of bits from different libraries, that are not working.

Can anyone give me a clue ?    I can't seem to find how much memory the printer has now for NVM users memory, I can delete the barcode bitmaps there - I dont need them now.


With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

I tried running the Adafruit thermal printer test, with their own logo, it works until it gets to the logos then it churns out about 100mm ( 4 " ) of garbage symbols and blanks..


I have loaded my logo into the printers nvmemory using the PC, but I cant find any details of how to print from the nvm.

The printer is supposed to be comapatable with the T88 commands, but the best manual for that I could find is written for windows codes or something, nothing like the Arduino I know a bit of.


With my mobile phone I can call people and talk to them -  how smart can you get ?

Osgeld

and why doesnt the 15k image fit on the 32k program space of the AVR?
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Boffin1

That was what I was trying at first, but the only example I could find was the adafruit sketch, where they suggest storing the bimap on a seperate tab, as logoname.cpp,   and changing its type to :-
static unsigned char_attribute_((progmem))logoname
but it will not compile as progmem has not been declared.

I copied the cpp into the libraries in case ( I tried the Thermal,  Adafruit-thermal, and the Adafruitthermal libraries )

I have tried several things, and eventually thought it might be easier to have the logo in the printers memory to call up when needed, but its also not easy....

With my mobile phone I can call people and talk to them -  how smart can you get ?

wildbill

Try putting the bitmap into your primary tab instead. If that fails, post your code.

Boffin1

Thanks Wildbill,

I have a bitmap lookup array for the 7 segment  LED displays, that I declare in the opening of the sketch, that looks like this :-

const byte digitTable [10] = { 
B01110111, B00010100, B01101101, B00111101, B00011110, B00111011, B01111011, B00010101, B01111111,B00111111 } ;

Do you think the logo should be similar?  I have used the LCDassistant software to generate the cpp as recommended on the adafruit thermal printer tutorial. and it is basically just a comma seperated load of bytes,  " radiant" is the name of the logo  :-

Code: [Select]
const unsigned char radiant [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x7C, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0F, 0x7E, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0xF8,
0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
etc.


And then I have to find the way to call up the array to feed to the printer.....  This is all abit new ( and interesting to me )
With my mobile phone I can call people and talk to them -  how smart can you get ?

wildbill

Given that that logo is 15K in size, it'll need to go in progmem:

Code: [Select]

#include <avr/pgmspace.h>

const prog_uchar radiant [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x7C, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0F, 0x7E, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0xF8,
0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

Boffin1

With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

OK  I have put that at the top, but with the ESC/POS method of calling it up is very confusing, I tried using the adafruit thermal library which is meant to make it easier, but it doesnt work with its own example, I just get gibberish when it comes to the barcodes or grahics ( the various text examples are fine )
With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

Just in case someone else has this problem with a thermal printer with eeprom storage for logos , I found the ESC POS commands for printing the stored logo image ( the manufacturers couldn't help ! )  in decimal it is :-

  thermal.print( 28, BYTE);
  thermal.print( 112, BYTE);
  thermal.print( 1, BYTE);    //  number 1 image in eeprom
  thermal.print( 3, BYTE);   //  double width double height

With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up