Giter VIP home page Giter VIP logo

micropython-waveshare-epd2in13's Introduction

Waveshare E-Paper 2.13" V2 display driver for devices running Micropython

This library is based on the work of Mike Causer and Dominik Kapusta.

When I was looking for a driver for couple of Waveshare 2.13" V2 red-black displays, I could not find anything usable. The example in Mike's repo is only partially working, and when I stumbled upon great library for 1.54" display, I decided to rework the lib a bit.

Features

  • Drawing lines (horizontal, vertical and between two arbitrary points)
  • Drawing rectangles and circles, both regular and filled
  • Drawing images from raw data (list or bytes object)
  • Adjusting screen orientation
  • Power saving mode (~30uA)

Usage

Initializing

The e-paper display uses 6 data lines for communication:

from machine import Pin, SPI
from lib import epd2in13
# SPI on ESP32 (Hardware SPI #2)
sck = Pin(18)
miso = Pin(19)  # NOT USED
mosi = Pin(23)
# Display config
dc = Pin(2)
cs = Pin(4)
rst = Pin(19)  # NOT USED
busy = Pin(5)
spi = SPI(2, baudrate=2000000, polarity=0, phase=0, bits=8, firstbit=0, sck=sck, miso=miso, mosi=mosi)
epd = epd2in13.EPD(spi, cs, dc, rst, busy)
epd.init()

On my module there is Reset line, and MISO is obviously not used in the communication.

Displaying data

Please see main.py for an example usage. In order to use fonts, copy them to fonts directory, or if you feel adventurous, freeze them in firmware. See this great blog post from Dominik for more info on how to do it.

micropython-waveshare-epd2in13's People

Contributors

firehawken avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.