EvoOLED#
- class EvoOLED(i2c, channel, addr=0x3C)#
SSD1306-style 128 x 64 monochrome OLED display.
EvoOLEDsubclassesframebuf.FrameBuffer, so standard MicroPython framebuffer drawing methods are also available.- begin()#
Initialise the OLED controller, clear the buffer and draw the empty screen.
- Returns:
True.
- clearDisplay()#
Clear the framebuffer and update the display.
- Returns:
None.
- sleep(value)#
Put the display to sleep when
valueis truthy, or wake it when false.- Returns:
None.
- setContrast(value)#
Set display contrast. Values are clamped to
0through255.- Returns:
None.
- invertDisplay(invert=True)#
Enable or disable inverse display mode.
- Returns:
None.
- setFlipOrientation(flip=False, draw=True)#
- flipDisplayOrientation(flip=None)#
Set or toggle the display orientation. When
drawis true, or when usingflipDisplayOrientation(), the display is refreshed.- Returns:
None.
- setFontSize(size)#
Select the built-in bitmap font size. Unsupported sizes fall back to size
7.- Returns:
None.
- writeToDisplay(value, x, y, clear=False, draw=False)#
Draw text at a pixel position.
clearclears the buffer first anddrawflushes the display after drawing.- Returns:
None.
- writeLineToDisplay(value, line, clear=False, draw=False)#
Draw text at the start of a text line calculated from the selected font size.
- Returns:
None.
- drawPixel(x, y, clear=False, draw=False)#
- drawLine(x0, y0, x1, y1, clear=False, draw=False)#
- drawRect(x, y, w, h, fill=False, clear=False, draw=False)#
- drawCircle(x, y, r, fill=False, clear=False, draw=False)#
- drawTriangle(x0, y0, x1, y1, x2, y2, clear=False, draw=False)#
Draw common primitives into the framebuffer.
cleardraws with color0instead of1;drawrefreshes the OLED after the operation.- Returns:
None.