circuitpython: Usage Example from Adafruit_CircuitPython_EPD States Output: "ValueError: SCK in use"

CircuitPython version

Adafruit CircuitPython 7.2.0

Code/REPL

import digitalio
import busio
import board
from adafruit_epd.epd import Adafruit_EPD
from adafruit_epd.il0373 import Adafruit_IL0373

# create the spi device and pins we will need
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
ecs = digitalio.DigitalInOut(board.D12)
dc = digitalio.DigitalInOut(board.D11)
srcs = digitalio.DigitalInOut(board.D10)    # can be None to use internal memory
rst = digitalio.DigitalInOut(board.D9)    # can be None to not use this pin
busy = digitalio.DigitalInOut(board.D5)   # can be None to not use this pin

# give them all to our driver
print("Creating display")
# Using the 2.9" ThinkInk Greyscale EPD Display (296X128)
display = Adafruit_IL0373(296, 128, spi,          # 2.13" Tri-color display
                          cs_pin=ecs, dc_pin=dc, sramcs_pin=srcs,
                          rst_pin=rst, busy_pin=busy)

display.rotation = 1

# clear the buffer
print("Clear buffer")
display.fill(Adafruit_EPD.WHITE)
display.pixel(10, 100, Adafruit_EPD.BLACK)

print("Draw Rectangles")
display.fill_rect(5, 5, 10, 10, Adafruit_EPD.RED)
display.rect(0, 0, 20, 30, Adafruit_EPD.BLACK)

print("Draw lines")
display.line(0, 0, display.width-1, display.height-1, Adafruit_EPD.BLACK)
display.line(0, display.height-1, display.width-1, 0, Adafruit_EPD.RED)

print("Draw text")
display.text('hello world', 25, 10, Adafruit_EPD.BLACK)
display.display()

Behavior

Below is a copy of the cody.py output:

code.py output: Traceback (most recent call last): File “code.py”, line 8, in <module> ValueError: SCK in use

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

I have read and understood “SCK in use error on feather m4 express #1088” and “nrf: implement checking for pin in use #1089”, which are referenced below. As far as I know, only 1 spi pin is in use.

I apologize if this isn’t the correct avenue for discussion. I understand if I am redirected to a more suitable channel.

https://github.com/adafruit/circuitpython/issues/1088 https://github.com/adafruit/circuitpython/issues/1089

Description

No response

Additional information

Hardware:

Adafruit Feather M4 Express with samd51j19 Board ID: feather_m4_express

2.9" ThinkInk Greyscale EPD Display

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

ok @makermelissa can try to replicate