Printertest Sketch
Printertest Sketch
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open-source hardware by purchasing products
from Adafruit!
#include "Adafruit_Thermal.h"
#include "adalogo.h"
#include "adaqrcode.h"
#include <avr/pgmspace.h>
void setup(){
Serial.begin(9600);
pinMode(7, OUTPUT); digitalWrite(7, LOW); // To also work w/IoTP printer
printer.begin();
// The following function calls are in setup(), but do not need to be.
// Use them anywhere! They're just here so they're run only one time
// and not printed over and over.
// Some functions will feed a line when called to 'solidify' setting.
// This is normal.
printer.underlineOn();
printer.println("Underlined text ");
printer.underlineOff();
printer.justify('C');
printer.println("normal\nline\nspacing");
printer.setLineHeight(50);
printer.println("Taller\nline\nspacing");
printer.setLineHeight(); // Reset to default
printer.justify('L');
// Barcode examples
printer.feed(1);
// CODE39 is the most common alphanumeric barcode
printer.printBarcode("ADAFRUT", CODE39);
printer.setBarcodeHeight(100);
// Print UPC line on product barcodes
printer.printBarcode("123456789123", UPC_A);
void loop() {
}