Git Product home page Git Product logo

pico-epaper's People

Contributors

phoreglad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pico-epaper's Issues

Showtime!

Hi all,
can't get the examples running.
Hardware used:

  • Waveshare Pico-ePaper 2.9B Version 3.
  • Pico W

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!

Centering text?

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.

Waveshare 4.2

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.

Are fonts possible?

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?

Setting own pins

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.