Skip to content

AttributeError: module 'adafruit_ssd1306' has no attribute 'SSD1306' #42

@Stormtracker017

Description

@Stormtracker017

Trying to interface three 0.96" 128x64 OLEDs to a RPI3B. When running the program, I get the following error:

Traceback (most recent call last):
  File "/home/pi/Desktop/GPS Python Programs/Multiple Display/gpsoledmulti.py", line 48, in <module>
    tsl1 = adafruit_ssd1306.SSD1306(tca[0])
AttributeError: module 'adafruit_ssd1306' has no attribute 'SSD1306'
import serial
import board
from PIL import Image, ImageDraw, ImageFont
import adafruit_ssd1306
import adafruit_tca9548a

ser = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=10)

i2c = board.I2C()  
tca = adafruit_tca9548a.TCA9548A(i2c)

tsl1 = adafruit_ssd1306.SSD1306(tca[0])
tsl2 = adafruit_ssd1306.SSD1306(tca[1])
tsl3 = adafruit_ssd1306.SSD1306(tca[2])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions