From 18cd0b0e537ca093003251e86d4c51f4cd7567a6 Mon Sep 17 00:00:00 2001 From: Brian Y Date: Tue, 10 Dec 2019 19:41:50 -0500 Subject: [PATCH] added delay between power off and deep sleep commands --- .../python/lib/waveshare_epd/epd2in7.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py index 12462ec..8edaffd 100644 --- a/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py +++ b/RaspberryPi&JetsonNano/python/lib/waveshare_epd/epd2in7.py @@ -158,15 +158,11 @@ class EPD: def send_command(self, command): epdconfig.digital_write(self.dc_pin, 0) - # epdconfig.digital_write(self.cs_pin, 0) epdconfig.spi_writebyte([command]) - # epdconfig.digital_write(self.cs_pin, 1) def send_data(self, data): epdconfig.digital_write(self.dc_pin, 1) - # epdconfig.digital_write(self.cs_pin, 0) epdconfig.spi_writebyte([data]) - # epdconfig.digital_write(self.cs_pin, 1) def ReadBusy(self): logging.debug("e-Paper busy") @@ -509,8 +505,9 @@ class EPD: def sleep(self): self.send_command(0X50) self.send_data(0xf7) - self.send_command(0X02) - self.send_command(0X07) + self.send_command(0X02) # power off + self.ReadBusy() + self.send_command(0X07) # deep sleep self.send_data(0xA5) epdconfig.module_exit()