standardize Clear() function
This commit is contained in:
parent
60762ac5a3
commit
bc79769c3f
@ -23,7 +23,7 @@ try:
|
|||||||
'''2Gray(Black and white) display'''
|
'''2Gray(Black and white) display'''
|
||||||
logging.info("init and Clear")
|
logging.info("init and Clear")
|
||||||
epd.init()
|
epd.init()
|
||||||
epd.clear()
|
epd.Clear()
|
||||||
font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
|
font24 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 24)
|
||||||
font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
|
font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
|
||||||
font35 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 35)
|
font35 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 35)
|
||||||
@ -145,7 +145,7 @@ try:
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
logging.info("Clear...")
|
logging.info("Clear...")
|
||||||
epd.clear()
|
epd.Clear()
|
||||||
logging.info("Goto Sleep...")
|
logging.info("Goto Sleep...")
|
||||||
epd.sleep()
|
epd.sleep()
|
||||||
|
|
||||||
|
@ -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)
|
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
|
return buf
|
||||||
|
|
||||||
def clear(self):
|
def Clear(self):
|
||||||
if(self.width % 8 == 0):
|
if(self.width % 8 == 0):
|
||||||
Width = self.width // 8
|
Width = self.width // 8
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user