Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

trouble using Trinket M0 and i2c device
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

trouble using Trinket M0 and i2c device

by 2600Sam on Thu Jul 02, 2020 5:06 am

ok, I'm using a trinket M0 and circuit python(Adafruit CircuitPython 5.3.0 on 2020-04-29) with a generic ht16k33 8x8 led matrix connected (correctly) to the board (checked, double-checked and verified by a friend). scl - d2, sda - d0, vcc - usb, gnd - gnd
when I run my code I get this error:
main.py output:
Traceback (most recent call last):
File "main.py", line 3, in <module>
File "adafruit_ht16k33/matrix.py", line 28, in <module>
File "adafruit_ht16k33/ht16k33.py", line 31, in <module>
ImportError: no module named 'adafruit_bus_device'

Code: Select all | TOGGLE FULL SIZE
import board
import busio
from adafruit_ht16k33 import matrix
i2c = busio.I2C(board.SCL, board.SDA)
matrix = matrix.Matrix8x8(i2c)
matrix.brightness = .1


using the same ht16k33 device (and connecting wires) on my raspberry pi it works great even the example codes run fine.
but on the trinket, I get the same error when the code gets to this line "from adafruit_ht16k33 import matrix"
I have copied the required library directory "adafruit_ht16k33" into the /lib directory on the trinket.(/lib/adafruit_ht16k33/ (all the .mpy files)).

is there something I have to set up on the trinket to do ic2 devices?
am I missing the easy thing to do?
help, please!

2600Sam
 
Posts: 2
Joined: Thu Jul 02, 2020 4:40 am

Re: trouble using Trinket M0 and i2c device

by dastels on Thu Jul 02, 2020 10:12 am

You are missing the bus device module. Copy the adafruit_bus_device directory from the library bundle to CIRCUITPY/lib.

Dave

dastels
 
Posts: 3076
Joined: Tue Oct 20, 2015 3:22 pm

Re: trouble using Trinket M0 and i2c device

by 2600Sam on Thu Jul 02, 2020 9:19 pm

dastels wrote:You are missing the bus device module. Copy the adafruit_bus_device directory from the library bundle to CIRCUITPY/lib.

Dave


yes that worked.
Thank you so much!!

2600Sam
 
Posts: 2
Joined: Thu Jul 02, 2020 4:40 am

Re: trouble using Trinket M0 and i2c device

by dastels on Fri Jul 03, 2020 9:34 am

Have fun!

Dave

dastels
 
Posts: 3076
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.