Hi folks.
Some code - just to save you time for starting fun with this nice ePaper display , as I could not find any good tutorial for beginners.
First of all - please follow the installation steps from their github page (Xinyuan-LilyGO/LilyGo-EPD47). Unfortunately the included examples do not clearly explain how to use the display for the active drawing. Please refer to the epd_driver.h code on the github or your computer.
Now - to have it working include "epd_driver.h", define framebuffer, init display, allocate memory, fill it white, power on, clear the display, define coordinates and so on, draw to a framebuffer, copy the framebuffer to the display using appropriate mode and power it off :
// the display dimensions are: WIDTH 960 , HEIGHT 540, so a single pixel drawn with
// epd_draw_pixel(...) function is barely visible !
#include "epd_driver.h"
uint8_t *_img;
void setup() {
epd_init();_img = (uint8_t *)heap_caps_malloc(EPD_WIDTH * EPD_HEIGHT / 2, MALLOC_CAP_SPIRAM);
memset(_img, 255 , EPD_WIDTH * EPD_HEIGHT / 2);
epd_poweron();epd_clear();
int x=0; int y =0; int radius=200;
epd_fill_circle( x,y,radius,0,_img);
epd_draw_image(epd_full_screen(), _img, BLACK_ON_WHITE);
epd_poweroff();
}
The display is very prone to ghosting. The included "repair" example seems to be not very helpful.
Reasonable solution is to physically switch it on and off to the power source several times and to be patient.
Unexpectedly if you run the above example with 2 lines commented:
//epd_fill_circle( x,y,radius,0,_img);
//epd_draw_image(epd_full_screen(), _img, BLACK_ON_WHITE);
and leave the display connected to the computer for 30-60s it magically reapairs the ghosting and is the most effective solution I have found.
Have a lot of fun !