Merge pull request #164 from txoof/add_color

add color argument
This commit is contained in:
SSYYL 2021-05-13 16:10:00 +08:00 committed by GitHub
commit 83a6cffae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -501,13 +501,13 @@ class EPD:
self.ReadBusy() self.ReadBusy()
# pass # pass
def Clear(self, color): def Clear(self, color=0xFF):
self.send_command(0x10) self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)): for i in range(0, int(self.width * self.height / 8)):
self.send_data(0xFF) self.send_data(color)
self.send_command(0x13) self.send_command(0x13)
for i in range(0, int(self.width * self.height / 8)): for i in range(0, int(self.width * self.height / 8)):
self.send_data(0xFF) self.send_data(color)
self.send_command(0x12) self.send_command(0x12)
self.ReadBusy() self.ReadBusy()

View file

@ -243,15 +243,15 @@ class EPD:
self.send_command(0x12) self.send_command(0x12)
self.ReadBusy() self.ReadBusy()
def Clear(self): def Clear(self, color=0x00):
self.send_command(0x10) self.send_command(0x10)
for i in range(0, int(self.width * self.height / 8)): for i in range(0, int(self.width * self.height / 8)):
self.send_data(0x00) self.send_data(color)
self.send_command(0x11) self.send_command(0x11)
self.send_command(0x13) self.send_command(0x13)
for i in range(0, int(self.width * self.height / 8)): for i in range(0, int(self.width * self.height / 8)):
self.send_data(0x00) self.send_data(color)
self.send_command(0x11) self.send_command(0x11)
self.send_command(0x12) self.send_command(0x12)