Skip to content

Add a variable to allow shifting the column address an arbitrary amount #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions adafruit_st7565.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class ST7565(framebuf.FrameBuffer):
# LCD Page Order
pagemap = (0, 1, 2, 3, 4, 5, 6, 7)

# LCD Start Bytes
start_bytes = 0

CMD_DISPLAY_OFF = const(0xAE)
CMD_DISPLAY_ON = const(0xAF)
CMD_SET_DISP_START_LINE = const(0x40)
Expand Down Expand Up @@ -146,9 +149,9 @@ def show(self):
# Set page
self.write_cmd(self.CMD_SET_PAGE | self.pagemap[page])
# Set lower bits of column
self.write_cmd(self.CMD_SET_COLUMN_LOWER | (0 & 0xF))
self.write_cmd(self.CMD_SET_COLUMN_LOWER | (self.start_bytes & 0xF))
# Set upper bits of column
self.write_cmd(self.CMD_SET_COLUMN_UPPER | ((0 >> 4) & 0xF))
self.write_cmd(self.CMD_SET_COLUMN_UPPER | ((self.start_bytes >> 4) & 0xF))

# Page start row
row_start = page << 7
Expand Down