display is working

This commit is contained in:
pepev-nrt 2025-01-25 18:06:41 +01:00
parent 526ddaa52e
commit 67b3c0e2d8
4 changed files with 206 additions and 7 deletions

View file

@ -23,13 +23,13 @@ class DisplayHelper:
# Updates the display with the grayscale and red images
# start displaying on eink display
# self.epd.clear()
self.epd.display(img)
self.epd.display(self.epd.getbuffer(img))
self.logger.info('E-Ink display update complete.')
def calibrate(self, cycles=1):
# Calibrates the display to prevent ghosting
white = Image.new('1', (self.screenwidth, self.screenheight), 'white')
black = Image.new('1', (self.screenwidth, self.screenheight), 'black')
white = Image.new('1', (self.epd.screenwidth, self.screenheight), 255)
black = Image.new('1', (self.screenwidth, self.screenheight), 0)
for _ in range(cycles):
self.epd.display(self.epd.getbuffer(black))
self.epd.display(self.epd.getbuffer(white))
@ -41,3 +41,8 @@ class DisplayHelper:
# send E-Ink display to deep sleep
self.epd.sleep()
self.logger.info('E-Ink display entered deep sleep.')
def clear(self):
# clear E-Ink display
self.epd.Clear(0xFF)
self.logger.info('E-Ink display entered deep sleep.')