class documentation

class OLED_0in91:

Constructor: OLED_0in91(i2c)

View In Hierarchy

0.91" OLED Display using SSD1306

This is a driver for the 0.91 inch OLED display using the SSD1306 controller. It uses the I2C interface to communicate with the display.

Method __init__ Construct the OLED driver
Method scroll_write Scroll and Write
Method show Show all pages on the Display
Method show_page Show a page on the display
Instance Variable page Array of pages
Method _init_display Initialize display
Method _write_cmd Write a command to the display This writes a command to the display using the I2C interface.
Method _write_data Undocumented
Instance Variable _addr Undocumented
Instance Variable _cmdBuff Undocumented
Instance Variable _i2c Undocumented
def __init__(self, i2c):

Construct the OLED driver

Initialise the SSD1306.

I2C and device errors are quietly ignored.

Parameters
i2cI2C driver.
def scroll_write(self, txt):

Scroll and Write

Scroll pages(lines) up by one line creating a blank line at the bottom (Page 4) and then put the text on the last line.

def show(self):

Show all pages on the Display

This shows all pages on the display by iterating through each page and calling show_page.

def show_page(self, pg_n):

Show a page on the display

This shows a page on the display by writing the data buffer to the display.

Parameters
pg_nThe page number to show. This should be between 0 and 3.
page =

Array of pages

def _init_display(self):

Initialize display

This initializes the display by sending the necessary commands to the SSD1306 controller. It sets the display to normal mode, sets the contrast, and sets the multiplex ratio. It also sets the display offset and the clock divide ratio.

def _write_cmd(self, cmd):

Write a command to the display This writes a command to the display using the I2C interface.

Parameters
cmdThe command to write to the display.
def _write_data(self, buf):

Undocumented

_addr =

Undocumented

_cmdBuff =

Undocumented

_i2c =

Undocumented