浏览代码

Fixed a bug in the sleep function introduced in another version of 3.7inch e-paper.

SSYYL 3 年之前
父节点
当前提交
395d30e35e

+ 2 - 5
Arduino/epd3in7/epd3in7.cpp

@@ -382,10 +382,7 @@ void Epd::Clear(UBYTE mode) {
  *          You can use EPD_Reset() to awaken
  */
 void Epd::Sleep(void) {
-    SendCommand(0X50);
-    SendData(0xf7);
-    SendCommand(0X02);   //power off
-    SendCommand(0X07);   //deep sleep
-    SendData(0xA5);
+    SendCommand(0X10);   //deep sleep
+    SendData(0x03);
 }
 /* END OF FILE */

+ 2 - 5
RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_3in7.c

@@ -584,9 +584,6 @@ parameter:
 ******************************************************************************/
 void EPD_3IN7_Sleep(void)
 {
-    EPD_3IN7_SendCommand(0X50);
-    EPD_3IN7_SendData(0xf7);
-    EPD_3IN7_SendCommand(0X02);  	//power off
-    EPD_3IN7_SendCommand(0X07);  	//deep sleep
-    EPD_3IN7_SendData(0xA5);
+    EPD_3IN7_SendCommand(0X10); //enter deep sleep
+    EPD_3IN7_SendData(0x03);
 }

+ 2 - 5
RaspberryPi_JetsonNano/python/lib/waveshare_epd/epd3in7.py

@@ -455,11 +455,8 @@ class EPD:
 
 
     def sleep(self):
-        self.send_command(0X50) # DEEP_SLEEP_MODE
-        self.send_data(0xf7)
-        self.send_command(0X02) #power off
-        self.send_command(0X07) #deep sleep
-        self.send_data(0xA5)
+        self.send_command(0X10) #deep sleep
+        self.send_data(0x03)
 
         epdconfig.delay_ms(2000)
         epdconfig.module_exit()

+ 2 - 5
STM32/STM32-F103ZET6/User/e-Paper/EPD_3in7.c

@@ -577,9 +577,6 @@ parameter:
 ******************************************************************************/
 void EPD_3IN7_Sleep(void)
 {
-    EPD_3IN7_SendCommand(0X50);
-    EPD_3IN7_SendData(0xf7);
-    EPD_3IN7_SendCommand(0X02);  	//power off
-    EPD_3IN7_SendCommand(0X07);  	//deep sleep
-    EPD_3IN7_SendData(0xA5);
+    EPD_3IN7_SendCommand(0X10);  	//deep sleep
+    EPD_3IN7_SendData(0x03);
 }