Explorar o código

Merge pull request #280 from txoof/standardize

Standardize library modules
Wilson %!s(int64=2) %!d(string=hai) anos
pai
achega
bb184dbc64

+ 2 - 2
RaspberryPi_JetsonNano/python/examples/epd_2in7_V2_test.py

@@ -23,7 +23,7 @@ try:
     '''2Gray(Black and white) display'''
     logging.info("init and Clear")
     epd.init()
-    epd.clear()
+    epd.Clear()
     font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
     font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
     font35 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 35)
@@ -145,7 +145,7 @@ try:
     time.sleep(2)
 
     logging.info("Clear...")
-    epd.clear()
+    epd.Clear()
     logging.info("Goto Sleep...")
     epd.sleep()
         

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd1in54.py

@@ -236,7 +236,7 @@ class EPD:
                 self.send_data(image[i + j * int(self.width / 8)])   
         self.TurnOnDisplay()
         
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         # self.SetWindow(0, 0, self.width - 1, self.height - 1)
         # send the color data
         self.SetWindow(0, 0, self.width, self.height)

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd1in54_V2.py

@@ -244,7 +244,7 @@ class EPD:
             
             self.set_lut(self.WF_Full_1IN54) # Set lut
         
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         if self.width%8 == 0:
             linewidth = int(self.width/8)
         else:

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13.py

@@ -201,7 +201,7 @@ class EPD:
                 self.send_data(image[i + j * linewidth])   
         self.TurnOnDisplay()
     
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         if self.width%8 == 0:
             linewidth = int(self.width/8)
         else:

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V2.py

@@ -280,7 +280,7 @@ class EPD:
         self.send_data2(image)  
         self.TurnOnDisplay()
     
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         if self.width%8 == 0:
             linewidth = int(self.width/8)
         else:

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in13_V3.py

@@ -361,7 +361,7 @@ class EPD:
     function : Clear screen
     parameter:
     '''
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         if self.width%8 == 0:
             linewidth = int(self.width/8)
         else:

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in7_V2.py

@@ -324,7 +324,7 @@ class EPD:
                         buf[int((newx + (newy * self.width))/4)] = ((pixels[x, y-3]&0xc0) | (pixels[x, y-2]&0xc0)>>2 | (pixels[x, y-1]&0xc0)>>4 | (pixels[x, y]&0xc0)>>6) 
         return buf
     
-    def clear(self):
+    def Clear(self):
         if(self.width % 8 == 0):
             Width = self.width // 8
         else:

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in9.py

@@ -185,7 +185,7 @@ class EPD:
                 self.send_data(image[i + j * int(self.width / 8)])   
         self.TurnOnDisplay()
         
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         self.SetWindow(0, 0, self.width - 1, self.height - 1)
         for j in range(0, self.height):
             self.SetCursor(0, j)

+ 1 - 1
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd2in9_V2.py

@@ -285,7 +285,7 @@ class EPD:
         self.send_data2(image)   
         self.TurnOnDisplay_Partial()
 
-    def Clear(self, color):
+    def Clear(self, color=0xFF):
         if self.width%8 == 0:
             linewidth = int(self.width/8)
         else:

+ 4 - 4
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd3in52.py

@@ -32,8 +32,8 @@ from multiprocessing.reduction import recv_handle
 from . import epdconfig
 
 # Display resolution
-EPD_width       = 240
-EPD_height      = 360
+EPD_WIDTH       = 240
+EPD_HEIGHT      = 360
 
 logger = logging.getLogger(__name__)
 
@@ -43,8 +43,8 @@ class EPD:
         self.dc_pin = epdconfig.DC_PIN
         self.busy_pin = epdconfig.BUSY_PIN
         self.cs_pin = epdconfig.CS_PIN
-        self.width = EPD_width
-        self.height = EPD_height
+        self.width = EPD_WIDTH
+        self.height = EPD_HEIGHT
         self.Flag = 0
         self.WHITE = 0xFF
         self.BLACK = 0x00