This commit is contained in:
ladyada 2019-09-29 01:38:04 -04:00
parent f557beff1a
commit b202863f31
3 changed files with 6 additions and 5 deletions

View file

@ -346,7 +346,7 @@ class Adafruit_EPD: # pylint: disable=too-many-instance-attributes, too-many-pub
pix = image.load() pix = image.load()
# clear out any display buffers # clear out any display buffers
self.fill(Adafruit_EPD.WHITE) self.fill(Adafruit_EPD.WHITE)
for y in range(image.size[1]): for y in range(image.size[1]):
for x in range(image.size[0]): for x in range(image.size[0]):
pixel = pix[x, y] pixel = pix[x, y]

View file

@ -94,7 +94,7 @@ class Adafruit_SSD1675B(Adafruit_EPD):
# pylint: disable=too-many-arguments # pylint: disable=too-many-arguments
def __init__(self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin): def __init__(self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin):
super(Adafruit_SSD1675B, self).__init__(width, height, spi, cs_pin, dc_pin, super(Adafruit_SSD1675B, self).__init__(width, height, spi, cs_pin, dc_pin,
sramcs_pin, rst_pin, busy_pin) sramcs_pin, rst_pin, busy_pin)
if width % 8 != 0: if width % 8 != 0:
width += (8 - width % 8) width += (8 - width % 8)
@ -155,7 +155,8 @@ class Adafruit_SSD1675B(Adafruit_EPD):
# Set ram X start/end postion # Set ram X start/end postion
self.command(_SSD1675B_SET_RAMXPOS, bytearray([0x00, self._width // 8])) self.command(_SSD1675B_SET_RAMXPOS, bytearray([0x00, self._width // 8]))
# Set ram Y start/end postion # Set ram Y start/end postion
self.command(_SSD1675B_SET_RAMYPOS, bytearray([0x0, 0x0, self._height-1, (self._height-1) >> 8])) self.command(_SSD1675B_SET_RAMYPOS,
bytearray([0x0, 0x0, self._height-1, (self._height-1) >> 8]))
# Border color # Border color
self.command(_SSD1675B_WRITE_BORDER, bytearray([0x03])) self.command(_SSD1675B_WRITE_BORDER, bytearray([0x03]))

View file

@ -38,8 +38,8 @@ display = Adafruit_SSD1675B(122, 250, spi, # 2.13" HD mono display (rev B)
#display = Adafruit_IL0373(128, 296, spi, # 2.9" Tri-color display #display = Adafruit_IL0373(128, 296, spi, # 2.9" Tri-color display
#display = Adafruit_IL0398(400, 300, spi, # 4.2" Tri-color display #display = Adafruit_IL0398(400, 300, spi, # 4.2" Tri-color display
#display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display #display = Adafruit_IL0373(104, 212, spi, # 2.13" Tri-color display
cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs, cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
rst_pin=rst, busy_pin=busy) rst_pin=rst, busy_pin=busy)
display.rotation = 3 display.rotation = 3
# Create blank image for drawing. # Create blank image for drawing.