浏览代码

Adjust reset timing

SSYYL 4 年之前
父节点
当前提交
abe28de022
共有 2 个文件被更改,包括 13 次插入7 次删除
  1. 8 4
      Arduino/epd7in5_V2/epd7in5_V2.cpp
  2. 5 3
      Arduino/epd7in5_V2/epd7in5_V2.ino

+ 8 - 4
Arduino/epd7in5_V2/epd7in5_V2.cpp

@@ -202,10 +202,12 @@ void Epd::SendData(unsigned char data) {
  */
 void Epd::WaitUntilIdle(void) {
     unsigned char busy;
+    Serial.print("e-Paper Busy\r\n ");
     do{
         SendCommand(0x71);
         busy = DigitalRead(busy_pin);
     }while(busy == 0);
+    Serial.print("e-Paper Busy Release\r\n ");
     DelayMs(20);
 }
 
@@ -215,6 +217,8 @@ void Epd::WaitUntilIdle(void) {
  *          see Epd::Sleep();
  */
 void Epd::Reset(void) {
+    DigitalWrite(reset_pin, HIGH);
+    DelayMs(20); 
     DigitalWrite(reset_pin, LOW);                //module reset    
     DelayMs(4);
     DigitalWrite(reset_pin, HIGH);
@@ -296,10 +300,10 @@ void Epd::Sleep(void) {
 
 void Epd::Clear(void) {
     
-    SendCommand(0x10);
-    for(unsigned long i=0; i<height*width; i++) {
-        SendData(0x00);
-    }
+    // SendCommand(0x10);
+    // for(unsigned long i=0; i<height*width; i++) {
+    //     SendData(0x00);
+    // }
     SendCommand(0x13);
     for(unsigned long i=0; i<height*width; i++)	{
         SendData(0x00);

+ 5 - 3
Arduino/epd7in5_V2/epd7in5_V2.ino

@@ -30,17 +30,19 @@
 
 void setup() {
   // put your setup code here, to run once:
-    Serial.begin(9600);
+    Serial.begin(115200);
     Epd epd;
     Serial.print("e-Paper init \r\n ");
     if (epd.Init() != 0) {
         Serial.print("e-Paper init failed\r\n ");
         return;
     }
-    Serial.print("e-Paper Clear\r\n ");
-    epd.Clear();
     
+    Serial.print("e-Paper Display\r\n ");
     epd.Displaypart(IMAGE_DATA,250, 200,240,103);
+
+    Serial.print("e-Paper Clear\r\n ");
+    epd.Clear();
 }
 
 void loop() {