phoreglad / pico-epaper Goto Github PK
View Code? Open in Web Editor NEWModule for driving Waveshare Pico e-Paper 3.7 display. Now with support for partial updates.
Module for driving Waveshare Pico e-Paper 3.7 display. Now with support for partial updates.
I have a https://www.waveshare.com/pico-epaper-2.13.htm
I wanted to use your code to make image that can be displayed on the smaller screen.
Resolution: 250 x 122 pixels
Display color: Black, white
Grey scale: 2
thank you so much I will also be asking for you help with modifying your converter code to work on that screen as well.
https://github.com/phoreglad/epaper-img-converter
guide also
Hi all,
can't get the examples running.
Hardware used:
Funny thing is i dont get errors its just saying:
Hell output:
`>>> %Run -c $EDITOR_CONTENT
show took: 217 ms to finish
show used around 240 B of memory
show took: 217 ms to finish
show used around 240 B of memory
`
But no display output. SPI wiring seems to be ok running code from the original Waveshare lib.
Any idea what I am missing?
I run Pico_ePaper.py in Thonny with MicroPhyton installed as interpreter.
THX!
Is there a simple way of working out the width of the rendered object after calling wri.printstring
?
I'd like to be able to centre text based on the screen width. I've been playing around with .clip_width and .char_width methods, but they don't seem to be set to the actual length of the rendered text on the screen. I tried the following in the REPL:
txt="This is a test"
from Pico_ePaper import Eink
from writer import Writer
import sys
sys.path.append("/fonts")
import dinomouse20, dinomouse30, dinomouse40
import framebuf
class DummyDevice(framebuf.FrameBuffer):
def __init__(self, width, height, buf_format):
self.width = width
self.height = height
self._buf = bytearray(self.width * self.height // 8)
super().__init__(self._buf, self.width, self.height, buf_format)
self.fill(1)
epd = Eink(rotation=270)
Data loading time: 6816 ms
dummy = DummyDevice(epd.width, epd.height, framebuf.MONO_HLSB)
wri = Writer(dummy, dinomouse40)
wri.set_clip(row_clip=True, col_clip=True, wrap=True)
wri.printstring(txt, invert=True)
Writer.set_textpos(dummy, 0, 0)
Orientation: Horizontal. Reversal: False. Width: 480. Height: 280.
Start row = 0 col = 0
(True, True, True)
(0, 0)
wri.char_width
19
epd.fill()
epd.blit(dummy, int(epd.width/2)-int(wri.char_width/2), 100, key=1)
epd.show()
Data loading time: 6842 ms
Renders as this.
Apologies if I'm using the wrong terminology, or indeed, using the wrong forum to ask questions. I'm very much at the beginning of my MicroPython journey, and trying to learn as I go along.
In partial refresh mode, even with the pixel values stored correctly in _bw, the show method is unable to show white pixels. It draws all the black pixels of the image but does not alter where the white pixels were supposed to be.
Hey there, i have the 4.2 epaper version (https://www.waveshare.com/wiki/Pico-ePaper-4.2-B#Overview) and trying to work out what i would need to change in your script in order to get it working for my screen?
I got the example code from Waveshare working (https://github.com/waveshare/Pico_ePaper_Code/blob/main/python/Pico-ePaper-4.2.py) but it's really limited (e.g. 8x8 pixel fonts only) and your code looks just like what i'm looking for, just can't work out what would be switched out to make it work. The Pins look the same..
Any steer would be appreciated!!
Sean.
You have saved my life with this repo. Whilst I'm an experienced Linux guy, I have little to no Micropython experience, so this enabled me to finally get my 3.7 ePaper working! Thank you.
Once question if I may? Is it possible to implement fonts within the text() method? I've seen lots of examples online, but I am really struggling to get them to work. Is there a simple(ish) method?
Just pulled your latest code, and found a problem:
I have my ESP32-S2 connected to the screen, rather than a Pico. Therefore, in the past I had just hard coded the pins into the init method. Now with the new code base, I use the following instead:
epd = Eink(rotation=270, cs_pin=36, dc_pin=14, reset_pin=8, busy_pin=9)
It then throws an error stating:
AttributeError: 'int' object has no attribute 'init'
I managed to get it working by changing each piece of code relating to the pin assignment. This may not be the best solution, but for each pin I changed the else part. Example:
From:
if reset_pin is None:
self._rst = Pin(12, Pin.OUT, value=0)
else:
self._rst = reset_pin
self._rst.init(Pin.OUT, value=0)
To:
if reset_pin is None:
self._rst = Pin(12, Pin.OUT, value=0)
else:
self._rst = Pin(reset_pin, Pin.OUT, value=0)
I don't know if there are any ramifications from making such a change, but I've tested out the text and graphics methods, and it does appear to work ok.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.