Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 27, 2024. It is now read-only.
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MicroPython Thermal Printer

This is the MicroPython port of Python Thermal Printer by Adafruit, available elsewhere on GitHub.

Read the full story at https://kapusta.cc/2017/12/11/thermal-printer-library-for-micropython/.

The summary of changes

  1. Removed Python 2.x code
  2. Removed writeToStdout()
  3. Replaced Serial with machine.UART
  4. Removed support for pre-2.68 firmware
  5. Removed image printing method, because it depended on Python Imaging Library
  6. Disabled calls to wake() and reset() at initialization
  7. Fixes to sleepAfter() and wake()

Additions

  • printBitmapFromFile() - allows for printing the bitmap from file on disk, instead of reading it from array of bytes like printBitmap() does.
  • printBMPImage() - allows for printing the actual .bmp image. Supports 1-bit Windows BMP format only, up to 384px wide.
  • heat dots, heat time and heat interval settings are parametrized in the initializer to fine tune printer output.

Usage

See printertest.py for usage example.

Testing

So far I tested it only with LoPy version 1. Works fine, besides printing large bitmaps that required too much memory for the LoPy (for the bitmap provided with printertest.py) - hence printBitmapFromFile().

About

The MicroPython port of Python Thermal Printer by Adafruit

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.