adafruit_ssd1306

MicroPython SSD1306 OLED driver, I2C and SPI interfaces

  • Author(s): Tony DiCola, Michael McWethy

class adafruit_ssd1306.SSD1306_I2C(*args: Any, **kwargs: Any)

I2C class for SSD1306

Parameters:
  • width – the width of the physical screen in pixels,

  • height – the height of the physical screen in pixels,

  • i2c – the I2C peripheral to use,

  • addr – the 8-bit bus address of the device,

  • external_vcc – whether external high-voltage source is connected.

  • reset – if needed, DigitalInOut designating reset pin

write_cmd(cmd: int) None

Send a command to the I2C device

write_framebuf() None

Blast out the frame buffer using a single I2C transaction to support hardware I2C interfaces.

class adafruit_ssd1306.SSD1306_SPI(*args: Any, **kwargs: Any)

SPI class for SSD1306

Parameters:
  • width – the width of the physical screen in pixels,

  • height – the height of the physical screen in pixels,

  • spi – the SPI peripheral to use,

  • dc – the data/command pin to use (often labeled “D/C”),

  • reset – the reset pin to use,

  • cs – the chip-select pin to use (sometimes labeled “SS”).

write_cmd(cmd: int) None

Send a command to the SPI device

write_framebuf() None

write to the frame buffer via SPI