thermal printer neophyte question

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
joboyd
 
Posts: 7
Joined: Mon Aug 18, 2014 10:23 am

thermal printer neophyte question

Post by joboyd »

Hi,
I am using an atmega8 USART to drive the thermal printer.
The print test works (press button and apply power)
How do I send data to the print buffer?
Also, as a test I send a LF but I get no response from the printer.
I am using the standard 8-N-1 serial protocol.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: thermal printer neophyte question

Post by adafruit_support_mike »

If you're rolling your own code, you probably need to configure the printer and set the correct mode before sending the actual print data.

You can use the Adafruit library as a working reference for how to do all that: https://github.com/adafruit/Adafruit-Th ... er-Library

User avatar
joboyd
 
Posts: 7
Joined: Mon Aug 18, 2014 10:23 am

Re: thermal printer neophyte question

Post by joboyd »

adafruit_support_mike wrote:If you're rolling your own code, you probably need to configure the printer and set the correct mode before sending the actual print data.

You can use the Adafruit library as a working reference for how to do all that: https://github.com/adafruit/Adafruit-Th ... er-Library
The function printer.print('\27')
sends ASCII ESC to the printer.
Is this in the Library?
I need to see how printer.print is coded.
The backslash denotes decimal.
Is there another symbol for hexadecimal.
I am working in assembly language and will be sending Hex.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: thermal printer neophyte question

Post by adafruit_support_mike »

The standard notation for hexidecimal in C uses the '0x' prefix: 0xff = 255 decimal.

The thermal printer class is derived from the Arduino Print class, which defines a set of 'print()' functions that take various arguments. Those functions are all defined in terms of a 'write()' function that gets overridden in the derived class.

The Adafruit library defines 'write()' using a macro that uses either a SoftwareSerial or a NewSoftSerial connection to bit-bang the UART protocol. If you already have that part, you don't need to dig into those libraries for implementation details.

User avatar
joboyd
 
Posts: 7
Joined: Mon Aug 18, 2014 10:23 am

Re: thermal printer neophyte question

Post by joboyd »

In your first reply you said I need to configure the printer and set the mode.
Can you explain what you mean by configure and mode?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: thermal printer neophyte question

Post by adafruit_support_mike »

A mode is a state of operation that responds to input in a specific way. The printer has modes for text, barcodes, and bitmaps. It has modes for various kinds of text prinout, including different sizes, italic, boldface, and so forth.

Configurating means telling the printer what to do. There are a lot of things you need to do before the printer is ready to accept input as "text to print".

Take a look at the Adafruit Thermal Printer library to see what information you need to send the printer before it's ready to put letters on paper:

https://github.com/adafruit/Adafruit-Th ... hermal.cpp

User avatar
joboyd
 
Posts: 7
Joined: Mon Aug 18, 2014 10:23 am

Re: thermal printer neophyte question

Post by joboyd »

So variables like "max heating dots", "heating time", "heating interval"
are not default but have to be set by the user?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: thermal printer neophyte question

Post by adafruit_support_mike »

That's correct.

User avatar
joboyd
 
Posts: 7
Joined: Mon Aug 18, 2014 10:23 am

Re: thermal printer neophyte question

Post by joboyd »

Thanks, this is not explained too well or at all in the manual supplied with the printer.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”