Skip to content

Waveshare Pico ePaper 2.13 B V4 Landscape MicroPython Driver

Notifications You must be signed in to change notification settings

RattyDAVE/EPD_2in13_B_V4_Landscape

Repository files navigation

EPD_2in13_B_V4_Landscape

Waveshare Pico ePaper 2.13 B V4 Landscape MicroPython Driver

This is a based off the official driver at https://github.com/waveshareteam/Pico_ePaper_Code/blob/main/python/Pico_ePaper-2.13-B_V4.py

To use:

epd = EPD_2in13_B_V4_Landscape()

Example test usage

from EPD_2in13_B_V4_Landscape import EPD_2in13_B_V4_Landscape

epd = EPD_2in13_B_V4_Landscape()
    
epd.imageblack.fill(0xff)
epd.imagered.fill(0xff)
epd.imageblack.text("This is a Test", 0, 10, 0x00)
epd.display()

All other methods function as normal.

epd.Clear(0xff, 0xff)
epd.imageblack.fill(0xff)
epd.imagered.fill(0xff)
epd.imageblack.text("Waveshare", 0, 10, 0x00)
epd.imagered.text("ePaper-2.13B", 0, 25, 0x00)
epd.imageblack.text("RPi Pico", 0, 40, 0x00)
epd.imagered.text("Hello World", 0, 55, 0x00)
epd.display()

Methods

epd.Clear(0xff, 0xff)

Directly writes to display with one colour.

epd.Clear(colorblack, colorred)

  • 0x00 - ON
  • 0xff - OFF
epd.display()

Writes frame buffer to display.

Draw the original shape

The following methods to draw shapes on framebuffer。

epd.imageblack.fill(c)
epd.imagered.fill(c)

Fills the entire framebuffer with the specified color。

epd.imageblack.pixel(x, y[, c])
epd.imagered.pixel(x, y[, c])

If C is not given, the color value of the specified pixel is obtained. If C is given, the specified pixel is set to the given color.

epd.imageblack.hline(x, y, w, c)
epd.imagered.hline(x, y, w, c)
epd.imageblack.vline(x, y, h, c)
epd.imagered.vline(x, y, h, c)
epd.imageblack.line(x1, y1, x2, y2, c)
epd.imagered.line(x1, y1, x2, y2, c)

Draws a line from a set of coordinates using a given color and a thickness of 1 pixel. The line method draws lines to the second set of coordinates, while the hline 和 vline methods draw horizontal and vertical lines respectively until the given length.

epd.imageblack.rect(x, y, w, h, c)
epd.imagered.rect(x, y, w, h, c)
epd.imageblack.fill_rect(x, y, w, h, c)
epd.imagered.fill_rect(x, y, w, h, c)

Draws a rectangle at a given location, size, and color. The rect method only draws 1 pixel outline, while th fill_rect method for drawing contour and interior.

Draw Text

epd.imageblack.text(s, x, y[, c])
epd.imagered.text(s, x, y[, c])

Use coordinates as top left corner of text to write text to FrameBuffer . The color of the text can be defined by optional parameters, but the default value is 1. The size of all characters is 8x8 pixels, and currently the font cannot be changed.

Other methods

epd.imageblack.scroll(xstep, ystep)
epd.imagered.scroll(xstep, ystep)

Move the contents of FrameBuffer according to the given vector. This may leave footprints of previous colors in FrameBuffer .

epd.imageblack.blit(fbuf, x, y[, key])
epd.imagered.blit(fbuf, x, y[, key])

Draw another FrameBuffer on the current one at the given coordinates`. If key is specified, it should be a color integer, and the corresponding color will be treated as transparent: all pixels with that color value will not be drawn.

This method works between instances of FrameBuffer with different formats, but due to color format mismatch, the resulting color may be unexpected.

Resources

About

Waveshare Pico ePaper 2.13 B V4 Landscape MicroPython Driver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages