Setup:
ESP32 WROOM 32 Devkit V1
Waveshare 4.2inch e-Paper Module rev2.2, b/w 4 gray with logic converter /added: Link to display
Waveshare demo library (Waveshare Download)
Waveshare demo library (github e-paper )
Software:
Photoshop to set the image size (400 x 300 pixels) and then convert to 4 gray scale
Image2lcd v3.2 to convert the image to c array and reverse the color for the display
Rightio guys, basically at the end of my tether with this one. Was hoping to make this as a gift for someone, however it's proved to be more challenging than I expected.
I have tried a number of library's to no avail, this includes the famous GxEPD library by @ZinggJM and I must say, the library and examples are written very well, however I have come to the conclusion that my revision of the display is not included, and so I have found that the demo from waveshare themselves seems to work to some extent. Documentation regarding commands and such seems to be lacking or I am just struggling to get my head around it.
My issue that I am coming up against is that when I generate my own bmp images and then convert them to c arrays, the image shows up zoomed in, however, when I use the images from the demo, there is no issues at all. so I am at a loss.
Any help is much appreciated! Thanks
Here is my code so far, it is basic, I am just trying to display an image at the moment...
/* Includes ------------------------------------------------------------------*/
#include "DEV_Config.h"
#include "EPD.h"
#include "GUI_Paint.h"
#include "imagedata.h"
#include <stdlib.h>
/* Entry point ----------------------------------------------------------------*/
void setup()
{
printf("EPD_4IN2_V2_test Demo\r\n");
DEV_Module_Init();
printf("e-Paper Init and Clear...\r\n");
EPD_4IN2_V2_Init();
EPD_4IN2_V2_Clear();
DEV_Delay_ms(500);
//Create a new image cache
UBYTE *BlackImage;
/* you have to edit the startup_stm32fxxx.s file and set a big enough heap size */
UWORD Imagesize = ((EPD_4IN2_V2_WIDTH % 8 == 0)? (EPD_4IN2_V2_WIDTH / 8 ): (EPD_4IN2_V2_WIDTH / 8 + 1)) * EPD_4IN2_V2_HEIGHT;
if((BlackImage = (UBYTE *)malloc(Imagesize)) == NULL) {
printf("Failed to apply for black memory...\r\n");
while (1);
}
printf("Paint_NewImage\r\n");
Paint_NewImage(BlackImage, EPD_4IN2_V2_WIDTH, EPD_4IN2_V2_HEIGHT, 0, WHITE);
#if 1 // show bmp
// printf("show window BMP-----------------\r\n");
Paint_SelectImage(BlackImage);
Paint_Clear(WHITE);
Paint_DrawBitMap(gImage_barb);
Paint_DrawImage(gImage_barb, 0, 0, 400, 300);
EPD_4IN2_V2_Display(BlackImage);
DEV_Delay_ms(2000);
#endif
// EPD_4IN2_V2_Init();
// EPD_4IN2_V2_Clear();
// printf("Goto Sleep...\r\n");
EPD_4IN2_V2_Sleep();
free(BlackImage);
BlackImage = NULL;
}
Following on from this, here is the BMP image I am using as a placeholder for now, it will not allow me to upload the BMP so here is the original image.
This is the c array code after I have set the size to 400 x 300 and converted the image to 4 gray scale
barb.c (150.2 KB)
And finally what i see in the screen of the display
My Settings on Image2LCD v3.2