I have a waveshare eink screen 2.7 inches (black and white, no red). I'm trying to make it work with micropython and my ESP32 board. I tested the screen first with an arduino uno board and the code provided here: https://www.waveshare.com/wiki/2.7inch_ ... rduino_UNO and the screen works. So my problem doesn't come from the screen.
I followed the example here: https://github.com/mcauser/micropython- ... ld/test.py, but adapted to my 2.7in screen. I uploaded the proper driver to the board. Here is my main.py:
Code: Select all
from machine import Pin, SPI
import time
import epaper2in7
import framebuf
# SPIV on ESP32
sck = Pin(18)
miso = Pin(19)
mosi = Pin(23)
dc = Pin(32)
cs = Pin(33)
rst = Pin(19)
busy = Pin(35)
spi = SPI(2, baudrate=20000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)
print("We're in main")
w = 176
h = 264
x = 0
y = 0
e = epaper2in7.EPD(spi, cs, dc, rst, busy)
e.init()
print("Screen ready")
buf = bytearray(w * h // 8)
fb = framebuf.FrameBuffer(buf, w, h, framebuf.MONO_HLSB)
black = 0
white = 1
fb.fill(black)
fb.fill(white)
fb.text("Hello World", 30, 0, black)
e.display_frame(buf)
from image_light import hello_world_light
# print('Image dark')
bufImage = hello_world_light
fbImage = framebuf.FrameBuffer(bufImage, 128, 296, framebuf.MONO_HLSB)
fb.blit(fbImage, 168, 2)
e.display_frame(buf)
print("Image printed")
time.sleep(3)
The wiring of my screen
At the moment, the screen doesn't display anything with micropython. It just seems to not receive any command. main.py executes without crashing though.
Could you please give me a hand?
I'm not sure about the wiring of the mosi, miso and csk pins. To which wires from the screen should they be connected?
How can I debug the problem?