has anyone else experienced inadvertent key activation with their NeoTrellis?
after seeing this thread i got excited about the prospect of using the NeoTrellis for a mini-grid or at least an interesting midi controller. i got one a couple months ago but i finally hooked everything up last night. after putting on some basic code (no monome-code or norns attachment yet) i found that i’m getting a weird problem: pressing a single key will randomly activate a bunch of other keys in the same “row”.
here’s a video of what i mean:
and here’s the code that i’m running for that video:
import time
from board import SCL, SDA
import busio
from adafruit_neotrellis.neotrellis import NeoTrellis
# create the i2c object for the trellis
i2c_bus = busio.I2C(SCL, SDA)
# create the trellis
trellis = NeoTrellis(i2c_bus)
# color definitions
ORANGE = (30, 20, 0)
WHITE = (5, 5, 6)
# this will be called when button events are received
def trigger(event):
if event.edge == NeoTrellis.EDGE_RISING:
trellis.pixels[event.number] = ORANGE
elif event.edge == NeoTrellis.EDGE_FALLING:
trellis.pixels[event.number] = WHITE
# startup
for i in range(16):
trellis.activate_key(i, NeoTrellis.EDGE_RISING)
trellis.activate_key(i, NeoTrellis.EDGE_FALLING)
trellis.callbacks[i] = trigger
trellis.pixels[i] = WHITE
time.sleep(.02)
while True:
# call the sync function call any triggered callbacks
trellis.sync()
# the trellis can only be read every 17 milliseconds or so
time.sleep(.02)
i thought maybe the lid was too tight, but i get the same problem when i take off the enclosure. any advice would be greatly appreciated.