Skip to content

Commit

Permalink
Update demo code for 4.2" display
Browse files Browse the repository at this point in the history
  • Loading branch information
squix78 committed Jan 31, 2019
1 parent 69c1f78 commit 90a58c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/EPaper/EPD_WaveShare_42/EPD_WaveShare_42.ino
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ uint16_t palette[] = {0, 1};

EPD_WaveShare42 epd(CS, RST, DC, BUSY);
MiniGrafx gfx = MiniGrafx(&epd, BITS_PER_PIXEL, palette);
uint32_t startMillis;

void setup() {
startMillis = millis();
Serial.begin(115200);
gfx.init();
gfx.setRotation(1);
gfx.setRotation(0);
gfx.setFastRefresh(false);
}

uint8_t rotation = 0;
Expand All @@ -94,8 +97,14 @@ void loop() {
gfx.drawString(10, 30, "Everything works!");
gfx.setFont(ArialMT_Plain_24);
gfx.drawString(10, 55, "Yes! Millis: " + String(millis()));
gfx.drawString(10, 80, "Rotation: " + String(rotation));
Serial.printf("Time until commit: %dms\n", (millis() - startMillis));
gfx.commit();

rotation = (rotation + 1) % 4;
delay(5000);
epd.Sleep();
Serial.printf("Time before sleep: %dms\n", (millis() - startMillis));
ESP.deepSleep(30 * 1000000, WAKE_RF_DEFAULT );
//delay(3000);

}

0 comments on commit 90a58c5

Please sign in to comment.