Skip to content

Instantly share code, notes, and snippets.

@boochow
Last active October 4, 2017 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boochow/b87cdd2064d7ba474ba3b52c21d5c8fb to your computer and use it in GitHub Desktop.
Save boochow/b87cdd2064d7ba474ba3b52c21d5c8fb to your computer and use it in GitHub Desktop.
from micropython import const
from ssd1306 import SSD1306_SPI
SET_LOW_COLUMN = const(0x00)
SET_HIGH_COLUMN = const(0x10)
SET_PAGE_ADDR = const(0xb0)
SET_DISP_START_LINE = const(0x40)
class SH1106_SPI(SSD1306_SPI):
def show(self):
for pg in range(0, self.pages):
for cmd in (
SET_PAGE_ADDR | pg,
SET_LOW_COLUMN | 2,
SET_HIGH_COLUMN | 0,
):
self.write_cmd(cmd)
self.write_data(self.buffer[pg * 0x80:(pg + 1) * 0x80])
@boochow
Copy link
Author

boochow commented Oct 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment