This is the error im getting:
Code: Select all
download ok
exec(open('./boot.py').read(),globals())
[0;31mE (477191) spi_master: spi_bus_initialize(108): host already in use[0m
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 25, in <module>
OSError: SPI device already in use
Code: Select all
import gc
gc.collect()
import framebuf
gc.collect()
from machine import Pin, SPI
gc.collect()
import driver
gc.collect()
# SPIV on ESP32
sck = Pin(18)
miso = Pin(19)
mosi = Pin(23)
dc = Pin(17)
cs = Pin(5)
rst = Pin(16)
busy = Pin(4)
spi = SPI(2, baudrate=20000000, polarity=0, phase=0, sck=sck, miso=miso, mosi=mosi)
e = driver.EPD(spi, cs, dc, rst, busy)
e.init()
w = 320
h = 192
x = 0
y = 0
# --------------------
# use a frame buffer
# 400 * 300 / 8 = 15000 - thats a lot of pixels
gc.collect()
buf = bytearray(w * h // 8)
fb = framebuf.FrameBuffer(buf, w, h, framebuf.MONO_HLSB)
black = 0
white = 1
fb.fill(white)
# --------------------
Thanks in advance!