Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial refresh between deep sleep #15

Open
allllo20 opened this issue Mar 7, 2024 · 0 comments
Open

partial refresh between deep sleep #15

allllo20 opened this issue Mar 7, 2024 · 0 comments

Comments

@allllo20
Copy link

allllo20 commented Mar 7, 2024

I'm trying to make a clock with this display and an ESP32. But whenever the ESP32 goes to deep sleep I can't partially refresh the display. Try following example:

#include <GxEPD2_BW.h>

#define GxEPD2_DRV_CLASS GxEPD2_290_BS

#define DISPLAY_PINOUT 5, 17, 16, 4 //ESP32

GxEPD2_BW<GxEPD2_DRV_CLASS, GxEPD2_DRV_CLASS::HEIGHT> display(GxEPD2_DRV_CLASS(DISPLAY_PINOUT)); // DEPG0290BS 128x296, SSD1680


RTC_DATA_ATTR byte hrs = 0;
RTC_DATA_ATTR byte mins = 0;
RTC_DATA_ATTR byte tag = 1;
RTC_DATA_ATTR byte monat = 3;

RTC_DATA_ATTR int count = 0;
void setup()
{
  Serial.begin(115200);
  Serial.println(count);
  delay(100);
  display.init(115200,(count==0),50,false);
  display.setRotation(3);
  display.setTextColor(GxEPD_BLACK);
}


void loop()
{
  tag++; tag %= 31;
  monat++; monat %= 12;
  mins++; mins %= 60;
  hrs++; hrs %= 24;

  display.setFullWindow();
  display.fillScreen(GxEPD_WHITE);

  display.setTextSize(2);
  display.setCursor(28 + 20, 14); display.printf("%02d.%02d.23", tag, monat);

  display.setTextSize(5);
  display.setCursor(5 + 20, 46); display.printf("%02d:%02d", hrs, mins);

  display.display(count!=0);
  display.hibernate();
  count++;
  esp_sleep_enable_timer_wakeup(5 * 1000000ULL);
  esp_deep_sleep_start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant