Last active
October 4, 2017 15:54
-
-
Save boochow/b87cdd2064d7ba474ba3b52c21d5c8fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://blog.boochow.com/article/453949310.html