Module OLED1306 :: Class OLED1306
[hide private]
[frames] | no frames]

Class OLED1306

source code

Class that represents a OLED display.

Instance Methods [hide private]
 
__init__(self)
Creates a OLED instance for the SSD1306 based chip.
source code
 
println(self, text)
Shows the given text with automatic line scrolling.
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
 
setText(self, text, lineNum=0, fontSize=None, indent=0)
Displays text at given line left adjusted.
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
 
stopBlinker(self)
Stops a running blinker.
source code
 
isBlinking(self)
Returns: True, if the blinker is displaying; otherwise False
source code
 
setInverse(self, inverse) source code
 
_checkRobot(self) source code
Method Details [hide private]

setText(self, text, lineNum=0, fontSize=None, indent=0)

source code 

       Displays text at given line left adjusted.
       The old text of this line is erased, other text is not modified
       The line distance is defined by the font size (text height + 1).
       If no text is attributed to a line, the line is considered to consist of a single space
       character with the font size of the preceeding line.
       The position of the text cursor is not modified.
       Text separated by 
is considered as a  multiline text. In this case lineNum is the line number of the
       first line.
       @param text: the text to display. If emtpy, text with a single space character is assumed.
       @param lineNum: the line number where to display the text (default: 0)
       @param fontSize: the size of the font (default: None, set to current font size)
       @indent: the line indent in pixels (default: 0)
       

startBlinker(self, count=3, offTime=1000, onTime=1000, blocking=False)

source code 

Blicks the entire screen for given number of times (off-on periods).

Parameters:
  • count - the number of blinking (default: 3)
  • offTime - the time the display is erased (in ms, default: 1000)
  • onTime - the time the display is shown (in ms, default: 1000)
  • blocking - if True, the function blocks until the blinking is finished; otherwise it returns immediately

stopBlinker(self)

source code 

Stops a running blinker. The method blocks until the blinker thread is finished and isBlinkerAlive() returns False.

isBlinking(self)

source code 
Returns:
True, if the blinker is displaying; otherwise False

setInverse(self, inverse)

source code 
Parameters:
  • inverse - if True, the background is white and the text is black; otherwise the background is black and the text is white (default)