I’m trying to display text on an e-paper display (link to Amazon) using MicroPython and the epaper1in54 library. I have confirmed the hardware connections are correct since everything works fine when using C.
However, when switching to MicroPython, nothing is rendered on the display. Here’s the code I’m using:
import epaper1in54
import framebuf
import machine
spi = machine.SPI(1)
cs = machine.Pin(17, machine.Pin.OUT) # D8
dc = machine.Pin(18, machine.Pin.OUT) # D9
rst = machine.Pin(21, machine.Pin.OUT) # D10
busy = machine.Pin(10, machine.Pin.IN) # D7
BLACK = 0
WHITE = 1
display = epaper1in54.EPD(spi, cs, dc, rst, busy)
display.init()
buffer = bytearray(display.width * display.height // 8)
fb = framebuf.FrameBuffer(buffer, display.width, display.height, framebuf.MONO_HLSB)
fb.fill(WHITE)
fb.text("AAAA", 10, 10, BLACK)
fb.rect(30, 90, 10, 10, BLACK)
display.set_frame_memory(buffer, 0, 0, display.width, display.height)
display.display_frame()
No errors are reported, but the display remains blank. Any ideas on what might be going wrong or what steps I could take to troubleshoot this issue?