コード例 #1
0
printer.print_line("Medium")
printer.set_size('S')
printer.print_line("Small")

printer.justify('C')
printer.print_line("normal\nline\nspacing")
printer.set_line_height(50)
printer.print_line("Taller\nline\nspacing")
printer.set_line_height() # Reset to default
printer.justify('L')

# Barcode examples
printer.feed(1)
# CODE39 is the most common alphanumeric barcode
printer.print_barcode("ADAFRUT", printer.CODE39)
printer.set_barcode_height(100)
# Print UPC line on product barcodes
printer.print_barcode("123456789123", printer.UPC_A)

# Print the 75x75 pixel logo in adalogo.py
import gfx.adalogo as adalogo
printer.print_bitmap(adalogo.width, adalogo.height, adalogo.data)

# Print the 135x135 pixel QR code in adaqrcode.py
import gfx.adaqrcode as adaqrcode
printer.print_bitmap(adaqrcode.width, adaqrcode.height, adaqrcode.data)
printer.print_line("Adafruit!")
printer.feed(1)

printer.sleep()      # Tell printer to sleep
printer.wake()       # Call wake() before printing again, even if reset