本文整理汇总了Python中Adafruit_Thermal.flush方法的典型用法代码示例。如果您正苦于以下问题:Python Adafruit_Thermal.flush方法的具体用法?Python Adafruit_Thermal.flush怎么用?Python Adafruit_Thermal.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adafruit_Thermal
的用法示例。
在下文中一共展示了Adafruit_Thermal.flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Adafruit_Thermal
# 需要导入模块: import Adafruit_Thermal [as 别名]
# 或者: from Adafruit_Thermal import flush [as 别名]
#!/usr/bin/python
from Adafruit_Thermal import *
printer = Adafruit_Thermal("/dev/ttyAMA0", 19200, timeout=5)
# Reset printer
printer.wake()
printer.flush()
printer.setDefault()
# Test inverse on & off
printer.inverseOn()
printer.println("Inverse ON")
printer.inverseOff()
# Test character double-height on & off
printer.doubleHeightOn()
printer.println("Double Height ON")
printer.doubleHeightOff()
# Test character double-width on & off
printer.doubleWidthOn()
printer.println("Double Width ON")
printer.doubleWidthOff()
# Set justification (right, center, left) -- accepts 'L', 'C', 'R'
printer.justify('R')
printer.println("Right justified")
printer.justify('C')
printer.println("Center justified")