I'm trying to get this working with a 256x64 OLED using SSD1322 SPI. I can't seem to get it to work I have the following edited.
# from luma.core.interface.serial import i2c
from luma.core.interface.serial import spi
from luma.core.render import canvas
from luma.oled.device import ssd1322
from RPi import GPIO
# clk = 17
# dt = 18
# btn = 27
# GPIO.setmode(GPIO.BCM)
# GPIO.setup(clk, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# GPIO.setup(dt, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# GPIO.setup(btn, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# clkLastState = GPIO.input(clk)
# substitute spi(device=0, port=0) below if using that interface
serial = spi(device=0, port=0)
# substitute ssd1331(...) or sh1106(...) below if using that device
device = ssd1322(serial)
Width = 256
Height = 64
But every time I run it, I get these errors (forgive me I don't code, just a tinkerer):
pi@oled-pi:~/Spotify-OLED-Control $ ./Spotify_OLED_Control.py
/home/pi/.local/lib/python3.9/site-packages/luma/core/interface/serial.py:206: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
self._gpio.setup(pin, self._gpio.OUT)
Now playing Bad Things (with Camila Cabello) by Machine Gun Kelly from SpotifyPaused
Process Process-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/Spotify-OLED-Control/./Spotify_OLED_Control.py", line 113, in run
track_w, self.h = draw.textsize(self.track, font=self.track_font)
AttributeError: 'ImageDraw' object has no attribute 'textsize'
Any ideas?