-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added LilyGo T5 4.7inch EPD PlatformIO example #79
Conversation
That looks interesting, thank you :) I'll try to review and test this this weekend! |
I wanted to do something a bit similar, but it went a bit too far I guess... Also I'm not exactly certain about the best practices here... but It looks like you have more advanced battery handling code (mine was a simple example I borrowed somewhere). Is a lookup table really needed in theory ? (I thought some linear math as you did was good enough....) |
epd_clear(); | ||
err = epd_hl_update_screen(&hl, MODE_GL16, temperature); | ||
epd_poweroff(); | ||
delay(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this produces rendering artifacts, because clear() is used without clearing the framebuffer.
I would clear the screen after power on, and then use the highlevel API:
`
void display_center_message(const char* text) {
epd_hl_set_all_white(&hl);
int cursor_x = EPD_WIDTH / 2;
int cursor_y = EPD_HEIGHT / 2;
if (orientation == EPD_ROT_PORTRAIT) {
// height and width switched here because portrait mode
cursor_x = EPD_HEIGHT / 2;
cursor_y = EPD_WIDTH / 2;
}
EpdFontProperties font_props = epd_font_properties_default();
font_props.flags = EPD_DRAW_ALIGN_CENTER;
epd_write_string(&FiraSans_12, text, &cursor_x, &cursor_y, fb, &font_props);
epd_poweron();
err = epd_hl_update_screen(&hl, MODE_GC16, temperature);
delay(500);
epd_poweroff();
delay(1000);
}
`
Also, the delays seem unnecessary for me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now use the epd_hl_set_all_white
method, but the delays reduce some artifacts or graying of the background in my testing.
Maybe they can be avoided with further changes to the driving code here
Thanks for the example, so far everything works with platformio. I noticed one issue where the text drawn after 30 seconds of run time produces weird artefacts. This is because the screen is cleared without setting the framebuffer to white. Could you fix that before the merge? |
Thanks for the great input. I'm new to electronic paper displays, so I'm thankful for all tips. |
Thanks, looks good :) |
@entozoon I wanted to comment on your PR that I tested it and that it really looks great and sharp with the added waveform 🎉 but it got merged already so here I'm glad I could help you and my long struggle with this was less of a waste |
Thanks @DavidM42, and yeah I'd have given up without your work. In fact, I'm pretty close again .. lol |
This adds an example how to use this library with the LilyGo T5 4.7 inch EPD device with an Esp32 on board and some exra features like buttons on the side.
It includes
As discussed here over on the repo of the manufacturer driver fork I think this would be a good kickstart for buyers of that device.
If anyone can test it and maybe suggest improvements to stop random screen greying of the background or how to improve the battery percentage calculation that would be greatly appreciated.
Thanks again for this nice library