Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/tve/micropython-inkplate6

MicroPython driver for the Inkplate 6
https://github.com/tve/micropython-inkplate6

driver e-paper epaper esp32 inkplate micropython micropython-drivers micropython-esp32

Last synced: 2 months ago
JSON representation

MicroPython driver for the Inkplate 6

Lists

README

        

Inkplate 6 & Inkplate 10
========================

This repository contains MicroPython drivers for the E-Radionica Inkplates 6 and 10:
an ESP32 board with a 6", respectively 10", E-paper display and three capacitive touch
buttons/sensors.

### Inkplate info

- CrowdSupply projects: https://www.crowdsupply.com/e-radionica/inkplate-6 and
https://www.crowdsupply.com/e-radionica/inkplate-10
- Hardware: https://github.com/e-radionicacom/Inkplate-6-hardware and
https://github.com/e-radionicacom/Inkplate-10-hardware
- Forum: http://forum.e-radionica.com/en/viewtopic.php?f=25&t=260

### Features

- Simple graphics class (similar to Adafruit GFX) for monochrome and 2-bit greyscale use of the
ePaper display.
- Simple graphics class for 2 bits per pixel greyscale use of the ePaper display.
- Support for partial updates (currently only on the monochrome display).
- Support for ("u8g2" fonts)[https://github.com/olikraus/u8g2] including rendering from the
compressed format.
- Access to touch sensors.
- Everything in pure python with screen updates virtually as fast as the Arduino C driver.

Getting started
---------------

- Flash MicroPython v1.12 `GENERIC_SPIRAM` or more recent to your inkplate, e.g.
`esp32spiram-idf4-20191220-v1.12.bin` from http://micropython.org/download/esp32/
(it's the very last download link on that page).

- Copy library files to your board, something like:
```
pyboard.py --device /dev/ttyUSB0 -f cp mcp23017.py shapes.py u8g2_font.py luRS24_te.u8f :
```
(You can find `pyboard.py` in the MicroPython tools directory or just download it from
GitHub: https://raw.githubusercontent.com/micropython/micropython/master/tools/pyboard.py)

- For the Inkplate 10 change the comments for `D_ROWS` and `D_COLS` around on lines 31-36
of `inkplate.py`.

- Run `inkplate.py`:
```
pyboard.py --device /dev/ttyUSB0 inkplate.py
```

- On the terminal console you should see a bunch of progress lines:
```
Mono: clean 857ms (17ms ea), draw 298ms (49ms ea), total 1155ms
GS2: clean 855ms (17ms ea), draw 696ms (99ms ea), total 1551ms
GFXPatt: in 102ms
Mono: clean 858ms (17ms ea), draw 297ms (49ms ea), total 1155ms
GFX: in 36ms
Partial: draw 166ms (33ms/frame 65us/row) (y=90..158)
...
```

- On the display you should see it clearing, then showing a monochrome test pattern, clearing and
showing a greyscale test pattern, then clearing and showing the following test pattern:
![hello world image](https://github.com/tve/mpy-inkplate/blob/master/img/hello_world.jpg?raw=true)

- The "Hello World" box should then move across the display using partial updates. Here's a video
of what that looks like (this is actual speed):

![hello world animation](https://user-images.githubusercontent.com/39480/89499537-09931100-d775-11ea-99ec-73f63c6c3010.gif)

Sorry for the hand-held shaking... It does look better in real-life when not quantized down to
fit into github!

- After a brief pause you will see the first test pattern again.
Touch the touchpad "3" to advance to the next test pattern.

- Look at the end of `inkplate.py` to see the demo code.

- An initial version of "u8g2" font support can be found in `u8g2_font.py`. The rendering is
currently not optimized due to a bug in MicroPython's viper code emitter (oops!) but the
performance seems reasonable. To try it out copy `inkplate.py` to flash:
```
pyboard.py --device /dev/ttyUSB0 -f cp inkplate.py :
```
Then run the demo:
```
pyboard.py --device /dev/ttyUSB0 u8g2_font.py
```
And have some patience until everything loads and draws incrementally until you see:
![alt text](https://github.com/tve/mpy-inkplate/blob/master/img/hello_font.jpg?raw=true)

- Additional fonts can be downloaded as C files from
https://github.com/olikraus/u8g2/tree/master/tools/font/build/single_font_files
(realistically you will need to grab the repo...), see (that repo's
wiki)[https://github.com/olikraus/u8g2/wiki/fntgrp] for an index to all
the fonts available. Once you grabbed a C file for the font, run
`./u8g2_convert.py