Drivers for Waveshare 2.13inch E-Ink display

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
devnull
Posts: 293
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by devnull » Fri May 18, 2018 8:47 am

Thanks for all of the help & suggestions, yes I use a TFT or OLED for permanent powered devices, but I am new to these screens and really trying to find out their capabilities and limitations and letting others know what I find so that they don't have to re-invent the wheel.

Both the applications I have in mind would be deployed on the other side of the world with no human intervention and running for over a year actually I am adding the display capability to existing designs which are already deployed and running.

AlbSan
Posts: 8
Joined: Thu Nov 02, 2017 2:44 am
Location: Shanghai

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by AlbSan » Sat Feb 16, 2019 11:29 am

Hi to all,
I'm trying to connect an ESP32 module (HelTec WIFI KIT-32) with WaveShare 296x128 2.9inch two color.
Using mcuser drivers for Waveshare e-paper, I receive this code error :

MPY: soft reboot
Traceback (most recent call last):
File "main.py", line 33, in <module>
File "epaper2in9.py", line 148, in clear_frame_memory
TypeError: can't convert bytes to int
MicroPython v1.10-98-g4daee3170 on 2019-02-14; ESP32 module with ESP32

main.py is the same of test.py , I changed only the SPI initialization to adapt it to my board.

Main.py line 33:

Code: Select all

e.clear_frame_memory(b'\xFF')
epaper2in9.py line 148:

Code: Select all

self._data(bytearray([color]))
what's wrong?
Thanks
Alberto

User avatar
Roberthh
Posts: 1239
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by Roberthh » Sat Feb 16, 2019 12:00 pm

The sample code is wrong. Using

Code: Select all

e.clear_frame_memory(0xff)
in test.py might work. Alternatively changing epaper2in9.py

Code: Select all

self._data(bytearray(color))

AlbSan
Posts: 8
Joined: Thu Nov 02, 2017 2:44 am
Location: Shanghai

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by AlbSan » Sat Feb 16, 2019 12:16 pm

Roberthh wrote:
Sat Feb 16, 2019 12:00 pm
The sample code is wrong. Using

Code: Select all

[b]e.clear_frame_memory(0xff)[/b]
in test.py might work.
Thanks a lot!
I don't see anything on the display :lol: but the code works now!

AlbSan
Posts: 8
Joined: Thu Nov 02, 2017 2:44 am
Location: Shanghai

Re: Drivers for Waveshare 2.13inch E-Ink display

Post by AlbSan » Sun Feb 17, 2019 4:32 am

Ok, I made progress! Now SPI communication works fine.
This is the configuration that works fine with my devices, HelTec WIFI KIT-32 and WaveShare 296x128 2.9inch two color:

Code: Select all

import machine
import epaper2in9
from machine import SPI, Pin

spi = SPI(-1, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=machine.Pin(18), mosi=machine.Pin(23), miso=machine.Pin(19))
cs = machine.Pin(2)
dc = machine.Pin(13)
rst = machine.Pin(14, machine.Pin.OUT)
busy = machine.Pin(27, machine.Pin.OUT)

e = epaper2in9.EPD(spi, cs, dc, rst, busy)
e.init()

w = 128
h = 296
x = 0
y = 0
Thanks for your help!

Post Reply