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 |
Scroll and Write |
| Method | show |
Show all pages on the Display |
| Method | show |
Show a page on the display |
| Instance Variable | page |
Array of pages |
| Method | _init |
Initialize display |
| Method | _write |
Write a command to the display This writes a command to the display using the I2C interface. |
| Method | _write |
Undocumented |
| Instance Variable | _addr |
Undocumented |
| Instance Variable | _cmd |
Undocumented |
| Instance Variable | _i2c |
Undocumented |
Construct the OLED driver
Initialise the SSD1306.
I2C and device errors are quietly ignored.
| Parameters | |
| i2c | I2C driver. |
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.
Show all pages on the Display
This shows all pages on the display by iterating through each page and calling show_page.
Show a page on the display
This shows a page on the display by writing the data buffer to the display.
| Parameters | |
| pg | The page number to show. This should be between 0 and 3. |
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.