소스 검색

add color argument

txoof 4 년 전
부모
커밋
96f0f803d3
2개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 3
      RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in7.py
  2. 3 3
      RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in7b.py

+ 3 - 3
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in7.py

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

+ 3 - 3
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in7b.py

@@ -243,15 +243,15 @@ class EPD:
         self.send_command(0x12) 
         self.ReadBusy()
         
-    def Clear(self):
+    def Clear(self, color=0x00):
         self.send_command(0x10)
         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(0x13)
         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(0x12)