Add the 4.37inch e-Paper (G) Python program

This commit is contained in:
SSYYL 2022-08-15 18:57:30 +08:00
commit 77c499d749
11 changed files with 348 additions and 83 deletions

View file

@ -54,8 +54,6 @@ class EPD:
self.YELLOW = 0x00ffff # 10
self.RED = 0x0000ff # 11
# Hardware reset
def reset(self):
epdconfig.digital_write(self.reset_pin, 1)
@ -124,13 +122,11 @@ class EPD:
self.send_data(0x4F)
self.send_data(0x6B)
self.send_command(0x06)
self.send_data(0xD7)
self.send_data(0xDE)
self.send_data(0x12)
self.send_command(0x61)
self.send_data(0x00)
self.send_data(0xA8)
@ -185,9 +181,6 @@ class EPD:
Width = self.width // 4 + 1
Height = self.height
self.send_command(0x68)
self.send_data(0x01)
self.send_command(0x04)
self.ReadBusyH()
@ -198,28 +191,20 @@ class EPD:
self.TurnOnDisplay()
def Clear(self, color):
def Clear(self, color=0x55):
if self.width % 4 == 0 :
Width = self.width // 4
else :
Width = self.width // 4 + 1
Height = self.height
self.send_command(0x68)
self.send_data(0x01)
self.send_command(0x04)
self.ReadBusyH()
self.send_command(0x10)
for j in range(0, Height):
for i in range(0, Width):
for k in range(0, 4):
self.send_data(color)
self.send_command(0x68)
self.send_data(0x00)
self.send_data(color)
self.TurnOnDisplay()