From ffcc222136efbc70bdd0280b1fd0756fba688e20 Mon Sep 17 00:00:00 2001 From: Brian Y Date: Sun, 15 Dec 2019 23:07:38 -0500 Subject: [PATCH] Update epd2in7.py --- .../python/lib/waveshare_epd/epd2in7.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py index a1ccc9b..3b60107 100644 --- a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py +++ b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py @@ -616,12 +616,15 @@ class EPD: # pass def Clear(self, color): + data = [color] * self.width * self.height / 8 self.send_command(DATA_START_TRANSMISSION_1) - for i in range(0, int(self.width * self.height / 8)): - self.send_data(0xFF) + # for i in range(0, int(self.width * self.height / 8)): + # self.send_data(0xFF) + [self.send_data(byte) for byte in data] self.send_command(DATA_START_TRANSMISSION_2) - for i in range(0, int(self.width * self.height / 8)): - self.send_data(0xFF) + # for i in range(0, int(self.width * self.height / 8)): + # self.send_data(0xFF) + [self.send_data(byte) for byte in data] # self.set_lut() self.send_command(DISPLAY_REFRESH) self.ReadBusy()