1

I have set up my Raspberry Pi Pico and successfully run several MicroPython examples, however, I am now trying to run the 1306 OLED example from Appendix A of the Raspberry Pi Pico Python SDK.

It fails on the second line of code:

from ssd1306 import SSD1306_I2C

When I run the above line of code either from the REPL or by saving the code to the Pico and running it via Thonny. I get an "ImportError: no module named ssd1306" Where do I find this module and how do I install it?

4

The module is in the Raspberry Pi's MicroPython repository.

To include it in your project:

  1. Copy the code to a new file in Thonny
  2. Save the file to the Pico as ssd1306.py

you should now be able to import without error.

1

https://github.com/adafruit/Adafruit_Python_SSD1306/

I believe this is the one as the SDK document specifically mentions the Adafruit OLED.

2
  • 1
    They look similar and this version may work, but I think the Pi's version should be considered the canonical version in this case, especially given the fact that Adafruit marks it as deprecated on their website. I also don't think the Pi Foundation would remove Adafruit's file header and copyright statement. I think the bigger issue is a documentation error/bug. – Steve Robillard Jan 28 at 5:12
  • 1
    Since you are a new user I also removed the non-family-friendly intro to your question rather than flagging it. – Steve Robillard Jan 28 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.