Skip to content

TypeError: 'bytearray' object does not support item assignment #4

Closed
@chris-schmitz

Description

@chris-schmitz

I'm new to both python and coding for arduino micro controllers so please bear with me if I missed something obvious.

I'm trying to use the trellis python library on a adafruit trinket M0. I read over the readme and installed the dependency list and installed the adafruit bus device lib directory on my trinket. I also double checked my boot_out.txt file on the trinket and confirmed that I'm a 2.0+ version of circuit python:

Adafruit CircuitPython 2.2.4 on 2018-03-07; Adafruit Trinket M0 with samd21e18

To start out I tried copy/pasting the readme demo code into my main.py file:

import time
import busio
from board import SCL, SDA
from adafruit_trellis import Trellis

# Create the I2C interface
i2c = busio.I2C(SCL, SDA)

# Create a Trellis object for each board
trellis = Trellis(i2c)  # 0x70 when no I2C address is supplied

# Turn on every LED
print('Turning all LEDs on...')
trellis.led.fill(True)
time.sleep(2)

# Turn off every LED
print('Turning all LEDs off...')
trellis.led.fill(False)
time.sleep(2)

The trellis was unresponsive, so I screened into the trinket to watch the output. When I did I received the following error message:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
main.py output:
Traceback (most recent call last):
  File "main.py", line 10, in <module>
  File "adafruit_trellis.py", line 155, in __init__
  File "adafruit_trellis.py", line 111, in fill
  File "adafruit_trellis.py", line 202, in show
TypeError: 'bytearray' object does not support item assignment

I've not dug yet into the adafruit_trellis.py file yet to wrap my head around what's going on. I wanted to post the issue here first to see if there's an obvious thing I'm missing.

Thanks!!

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