minor improvements

Added sleep function for the E-Paper display to prevent ghosting
This commit is contained in:
Ace 2018-10-01 01:22:38 +02:00 committed by GitHub
parent 1627b2da42
commit 1d5b8a1a43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,11 +4,12 @@ from PIL import Image, ImageDraw, ImageFont
EPD_WIDTH = 640
EPD_HEIGHT = 384
epd = epd7in5b.EPD()
def calibration():
for i in range(2):
epd = epd7in5b.EPD()
epd.init()
black = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 0)
black = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 0)
print('calibrating black...')
ImageDraw.Draw(black)
epd.display_frame(epd.get_frame_buffer(black))
@ -17,17 +18,14 @@ def calibration():
ImageDraw.Draw(red)
print('calibrating red...')
epd.display_frame(epd.get_frame_buffer(red))
white = Image.new('L', (EPD_WIDTH, EPD_HEIGHT), 255)
white = Image.new('1', (EPD_WIDTH, EPD_HEIGHT), 255)
ImageDraw.Draw(white)
print('calibrating white...')
epd.display_frame(epd.get_frame_buffer(white))
epd.sleep()
print('Cycle complete!')
def main():
epd = epd7in5b.EPD()
epd.init()
for i in range(1):
calibration()