Thanks for your example, it worked really well for me with some simple changes to work with the SPI version of the display that I have.
from machine import SPI, Pin
from ssd1306 import SSD1306_SPI
import framebuf
# Assign chip select (CS) pin
cs = machine.Pin(16, machine.Pin.OUT)
dc =...