From fba706a62d9a3d397a00f3fa2e58c2e9fd55e716 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 20 Mar 2024 15:35:00 +0100 Subject: [PATCH] README: show a more complete GS8 fb exmaple. --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fece7b0..a126390 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,7 @@ Mirroring can be enabled in both x and y axis with the `mirror_x` and `mirror_y` To test the driver quickly, do: - mpremote cp uc8151.py : - mpremote run demo_no_flick.py + mpremote run uc8151.py The demo code has pins configured for the Badger 2040. @@ -104,6 +103,21 @@ It is possible to display regular GS8 framebuffers, too. # Then draw the framebuffer on the screen: eink.update_greyscale(fb,32) +This is a complete example using MicroPython Framebuffer, filling the screen with squares of different sizes. + +```python +gs8buf = bytearray(128*296) +gsfb = framebuf.FrameBuffer(gs8buf,128,296,framebuf.GS8) +square_id = 0 +for x in range(0,128,128//4): + for y in range(0,296,296//8): + color = int((255/31)*square_id) + gsfb.fill_rect(x,y,128//4,296//8,color) + square_id += 1 + +eink.update_greyscale(gs8buf,32) +``` + # What I learned about setting waveforms/LUTs for EDPs The world of e-paper displays is one of the most undocumented you can find: this is the unfortunate side effects of patented technologies, as there is a strong incentive to avoid disclosing useful information, with the effect of slowing down software progresses towards programming these kind of displays. The only source of information I was able to find: