Skip to content

Instantly share code, notes, and snippets.

@kd8bxp
Created March 11, 2021 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kd8bxp/1e970eb449ad0a14bc746b2d5496dccb to your computer and use it in GitHub Desktop.
Save kd8bxp/1e970eb449ad0a14bc746b2d5496dccb to your computer and use it in GitHub Desktop.
Original example found here: https://github.com/martinberlin/cale-idf/wiki/Parallel-epapers-driven-by-Epdiy-with-I2S-Data-bus These are the small changes I made to get it to compile with esp-idf v4.3-beta1
added line 6
changed line 39 - from display.setFont(&Ubuntu_M36pt7b); to display.setFont(&Ubuntu_M24pt8b);
added line 41 display.update();
// Run idf.py menuconfig-> Component Config -> E-Paper driver and select:
// Display type: LILIGO 4.7 ED047TC1
// Board: LILIGO T5-4.7 Epaper
// In the same section Component Config -> ESP32 Specifics -> Enable PSRAM
#include "parallel/ED047TC1.h"
#include "freertos/task.h"
Ed047TC1 display;
// Include a font header
#include <Fonts/ubuntu/Ubuntu_M24pt8b.h>
extern "C" { void app_main(); }
void delay(uint32_t millis) { vTaskDelay(millis / portTICK_PERIOD_MS); }
void app_main(void)
{
display.init(true);
display.setRotation(1); // Working, 1 rotates 90° the display
// Clear all screen to white
display.clearScreen();
delay(1000);
// Draw some rectangles
for (int x = 0; x < 200; x++) {
for (int y = 0; y < 400; y++) {
display.drawPixel(x, y, 0);
display.drawPixel(x+200, y, 80);
display.drawPixel(x+400, y, 160);
display.drawPixel(x+600, y, 200);
display.drawPixel(x+760, y, 230);
}
}
// Draw some text using Ubuntu Font
display.setCursor(30,200);
display.setFont(&Ubuntu_M24pt8b);
display.println("Hello world");
display.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment