7 segment display

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
johnf
 
Posts: 6
Joined: Mon May 03, 2010 1:22 pm

7 segment display

Post by johnf »

I am getting an AttributeError: 'module' object has no attribute 'Seg7x4'
trying to use an Adafruit .56 in i2C 7 segment display with a
Metro Express using circuit python

My lib looks like this:

Shelley:circuitpy john$ cd lib
Shelley:lib john$ ls
adafruit_bus_device adafruit_ht16k33 neopixel.mpy
adafruit_dotstar.mpy adafruit_register simpleio.mpy
adafruit_hid adafruit_waveform
Shelley:lib john$

This is my code copied (I think and hope) from the AF tutorial.
Adafruit CircuitPython 2.2.0 on 2018-01-02; Adafruit Metro M0 Express with samd21g18
>>> import board
>>> import busio as io
>>> i2c = io.I2C(board.SCL, board.SDA)
>>> import adafruit_ht16k33.segments
>>> display = adafruit_ht16k33.Seg7x4(i2C)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Seg7x4'

User avatar
danhalbert
 
Posts: 4654
Joined: Tue Aug 08, 2017 12:37 pm

Re: 7 segment display

Post by danhalbert »

A little typo: do this:

Code: Select all

>>> import adafruit_ht16k33.segments
>>> display = adafruit_ht16k33.segments.Seg7x4(i2C)  # add .segments

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”