adafruit / Adafruit_SSD1306

Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs
http://www.adafruit.com/category/63_98
Other
1.78k stars 976 forks source link

RuntimeError: Could not determine platform. #227

Closed songshuailin closed 2 years ago

songshuailin commented 2 years ago

Traceback (most recent call last): File "oled.py", line 16, in disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST) File "/usr/local/lib/python3.8/dist-packages/Adafruit_SSD1306/SSD1306.py", line 287, in init super(SSD1306_128_32, self).init(128, 32, rst, dc, sclk, din, cs, File "/usr/local/lib/python3.8/dist-packages/Adafruit_SSD1306/SSD1306.py", line 85, in init self._gpio = GPIO.get_platform_gpio() File "/usr/local/lib/python3.8/dist-packages/Adafruit_GPIO/GPIO.py", line 426, in get_platform_gpio raise RuntimeError('Could not determine platform.') RuntimeError: Could not determine platform.

dhalbert commented 2 years ago

You are using the https://github.com/adafruit/Adafruit_Python_SSD1306 library. That library is deprecated and no longer supported. Try using the https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 library, which uses adafruit-blinka to allow CIrcuitPython code to run on your platform (if it is supported).