Micropython Rapsberry Pico“没有名为 ffi 的模块”在 SSD1306 库上

发布于 2025-01-20 21:57:03 字数 756 浏览 4 评论 0原文

我是新来的:) 我买了带液晶屏的 Rapsberry Pico,我想在这个显示器上显示一些东西,但是当我导入 ssd1306 lib Thonny 时,给我发了一个问题“没有名为 ffi 的模块”,我不知道如何导入这个库。 这是我的简单代码:

from machine import Pin, I2C
import ssd1306

i2c = I2C(scl=Pin(1), sda=Pin(0), freq=400000)
display = ssd1306.SSD1306_I2C(128, 64, i2c)
display.text("some text", 0, 0)
display.show()

我在 ofc 之前安装了 micropython-ssd1306 lib。

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "ssd1306.py", line 4, in <module>
  File "/lib/framebuf.py", line 2, in <module>
  File "/lib/usdl2.py", line 2, in <module>
ImportError: no module named 'ffi'

MicroPython v1.13-395-gcb04da56d 于 2021 年 1 月 12 日发布;带 RP2040 的树莓派 Pico

Im new here :)
I bought the Rapsberry Pico with the lcd screen, i want to display something on this display but when i import ssd1306 lib Thonny send me a problem "no module named ffi" i don't know how to import this lib.
Thats my simple code:

from machine import Pin, I2C
import ssd1306

i2c = I2C(scl=Pin(1), sda=Pin(0), freq=400000)
display = ssd1306.SSD1306_I2C(128, 64, i2c)
display.text("some text", 0, 0)
display.show()

I installed micropython-ssd1306 lib before ofc.

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "ssd1306.py", line 4, in <module>
  File "/lib/framebuf.py", line 2, in <module>
  File "/lib/usdl2.py", line 2, in <module>
ImportError: no module named 'ffi'

MicroPython v1.13-395-gcb04da56d on 2021-01-12; Raspberry Pi Pico with RP2040

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文