Hi -
I read through some posts, but could not find one matching my WaveShare 3.52inch E-Paper display. I have some code and got it working to a certain extent. Below is the example that comes with the library:
#include <SPI.h>
#include "EPD_3in52.h"
#include "imagedata.h"
#include "epdpaint.h"
#define COLORED 0
#define UNCOLORED 1
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Epd epd;
if (epd.Init() != 0) {
Serial.print("e-Paper init failed");
return;
}
Serial.print("3.52inch e-paper demo\r\n ");
Serial.print("e-Paper Clear\r\n ");
epd.display_NUM(EPD_3IN52_WHITE);
epd.lut_GC();
epd.refresh();
epd.SendCommand(0x50);
epd.SendData(0x17);
delay(2000);
// UBYTE image[700];
// Paint paint(image, 200, 25); // width should be the multiple of 8
// paint.SetRotate(ROTATE_0);
// paint.Clear(COLORED);
// Serial.print("Drawing:BlackImage\r\n ");
// paint.DrawStringAt(0, 0, "e-Paper Demo", &Font24, UNCOLORED);
// epd.display_part(paint.GetImage(), 0, 0, paint.GetWidth(), paint.GetHeight());
// epd.lut_GC();
// epd.refresh();
// delay(2000);
epd.display(IMAGE_DATA);
epd.lut_GC();
epd.refresh();
delay(2000);
Serial.print("clear and sleep......\r\n ");
epd.Clear();
delay(2000);
epd.sleep();
Serial.print("end\r\n ");
}
void loop() {
// put your main code here, to run repeatedly:
}
Off the bat this does not compile. There seems to be an issue here:
epd.display(IMAGE_DATA);
With the code below, I am at least able to print a single line of text and move it around, but for the life of me, I cannot get it to print two lines of text
#include <SPI.h>
#include "../lib/E_Paper/src/EPD_3in52.h"
#include "../lib/E_Paper/src/imagedata.h"
#include "../lib/E_Paper/src/epdpaint.h"
#define COLORED 0
#define UNCOLORED 1
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Epd epd;
if (epd.Init() != 0) {
Serial.print("e-Paper init failed");
return;
}
Serial.print("3.52inch e-paper demo\r\n ");
Serial.print("e-Paper Clear\r\n ");
epd.display_NUM(EPD_3IN52_WHITE);
epd.lut_GC();
epd.refresh();
epd.SendCommand(0x50); // not sure what this is for
epd.SendData(0x17); // not sure what this is for
delay(2000);
UBYTE image[1000];
Paint paint(image, 240, 30); // width should be the multiple of 8
paint.SetRotate(0);
paint.Clear(COLORED);
paint.DrawStringAt(25, 0, "WELCOME", &Font24, UNCOLORED);
epd.display_part(paint.GetImage(), 0, 10, paint.GetWidth(), paint.GetHeight());
epd.lut_GC();
epd.refresh();
//epd.display(IMAGE_DATA);
// epd.lut_GC();
// epd.refresh();
// delay(2000);
// Serial.print("clear and sleep......\r\n ");
// epd.Clear();
delay(2000);
epd.sleep();
// Serial.print("end\r\n ");
}
void loop() {
delay(2000);
}
Also hoping I can increase the font size beyond 24, but I will deal with that once I get multiple text strings to print. Rotation also seem to be buggy, but will look into that a bit more.
Hoping someone can help.
Regards,
Friedl.