UIFlow2 Display

Aus Micropython Referenz
Zur Navigation springen Zur Suche springen

Display Funktionen

Die M5Stack Firmware der Version2 enthält die Klassen Display und Lcd. Lcd stammt vermutlich aus der Version1. Deshalb kann die Anwendung der Methoden dort gefunden werden.

>>> dir(M5.Display)
['__class__', 'clear', 'close', 'print', 'read', 'write', 'COLOR', 'FONTS', 'drawArc', 'drawBmp', 'drawCenterString', 'drawCircle', 'drawEllipse', 'drawEllipseArc', 'drawImage', 'drawJpg', 'drawLine', 'drawPixel', 'drawPng', 'drawQR', 'drawRawBuf', 'drawRect', 'drawRightString', 'drawRoundRect', 'drawString', 'drawTriangle', 'endWrite', 'fillArc', 'fillCircle', 'fillEllipse', 'fillEllipseArc', 'fillRect', 'fillRoundRect', 'fillScreen', 'fillTriangle', 'fontHeight', 'getBrightness', 'getColorDepth', 'getCursor', 'getRotation', 'height', 'loadFont', 'newCanvas', 'printf', 'setBrightness', 'setColorDepth', 'setCursor', 'setFont', 'setRotation', 'setTextColor', 'setTextScroll', 'setTextSize', 'startWrite', 'textWidth', 'unloadFont', 'width']
>>> dir(M5.Lcd)
['__class__', 'clear', 'close', 'print', 'read', 'write', 'COLOR', 'FONTS', 'drawArc', 'drawBmp', 'drawCenterString', 'drawCircle', 'drawEllipse', 'drawEllipseArc', 'drawImage', 'drawJpg', 'drawLine', 'drawPixel', 'drawPng', 'drawQR', 'drawRawBuf', 'drawRect', 'drawRightString', 'drawRoundRect', 'drawString', 'drawTriangle', 'endWrite', 'fillArc', 'fillCircle', 'fillEllipse', 'fillEllipseArc', 'fillRect', 'fillRoundRect', 'fillScreen', 'fillTriangle', 'fontHeight', 'getBrightness', 'getColorDepth', 'getCursor', 'getRotation', 'height', 'loadFont', 'newCanvas', 'printf', 'setBrightness', 'setColorDepth', 'setCursor', 'setFont', 'setRotation', 'setTextColor', 'setTextScroll', 'setTextSize', 'startWrite', 'textWidth', 'unloadFont', 'width']

Lcd ist nur ein weiterer Name für Display:

>>> M5.Lcd.circle(100, 100, 20, color=0xffffff)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Display' object has no attribute 'circle'
>>>