Creates a display instances with given OLED display type (128x32 or
128x64, black & white). with standard font from font file
/usr/share/fonts/truetype/freefont/FreeSans.ttf. All public methods
(except ctor and blinker methods) are thread-safe (locked by a static
RLock.
|
|
|
|
|
setBkImage(self,
bkImagePath)
Defines a background image to be displayed with next setText() or
show(). |
source code
|
|
|
setFont(self,
ttfFile,
fontSize=10)
Sets a new font defined by the given TTF font file. |
source code
|
|
|
setFontSize(self,
fontSize)
Sets a new font size of current font. |
source code
|
|
|
clear(self)
Erases the display and clears the text buffer. |
source code
|
|
|
erase(self)
Erases the display without clearing the text buffer. |
source code
|
|
|
setText(self,
text,
lineNum=0,
fontSize=None,
indent=0)
Displays text at given line left adjusted. |
source code
|
|
|
|
|
|
|
repaint(self)
Repaints the screen (background image and text buffer). |
source code
|
|
|
showImage(self,
imagePath)
Shows the image (1 pixel monochrome) with given filename (must have
size 128x32 for display type 32 or 128x64 for display type 64). |
source code
|
|
|
println(self,
text)
Appends text at current cursor position and scrolls, if necessary. |
source code
|
|
|
setNumberOfLines(self,
nbLines)
Sets the current font size to a maximum to show the given number of
lines. |
source code
|
|
|
|
|
startBlinker(self,
count=3,
offTime=1000,
onTime=1000,
blocking=False)
Blicks the entire screen for given number of times (off-on periods). |
source code
|
|
|
|
|
|
|
isDeviceAvailable(self)
Returns True, if the device is detected on the I2C bus; otherwise
returns False |
source code
|
|