Datasheet

You can set or clear LEDs with trellis.setLED(
n
) and trellis.clrLED(
n
) where n is the LED # from 0 to (number of
Trellis')*16-1. So if you have 4 Trellis's in a set, thats 0 to 63
You can only turn LEDs on or off, there is no grayscale or PWM on this chip
When you are done setting and clearing LEDs you must call writeDisplay() to send the data to all the boards:
trellis.writeDisplay() will write all Trellis PCBs in the set at once
You can also test if an LED is lit with trellis.isLED(
n
) - will return true if the LED is lit, and false if it isn't
Reading Switches
You can read buttons by calling
trellis.readSwitches()
It will return true if there has been any change in switches since the last time you called readSwitches(). So if some
buttons were pressed and now aren't or vice versa, it will return true. If nothing's changed, it will return false
Once you've read the switches, you can query the TrellisSet about them.
If you'd like to know if a key #k (k is 0..(number of Trellis')*16-1) is currently pressed, call
isKeyPressed(
k
)
If you want to know if there was a
change
in the button, you can ask if it's been pressed or released since the last call
to readSwitches()
trellis.justReleased(
k
)
trellis.justPressed(
k
)
Adding support for more tiles
You can tile up to 8 Trellis PCBs together (see the next page for the mechanical connections of doing so)
Make sure each Trellis has a unique address ID!
Open up the TrellisTest sketch and change the following
Make more objects
After
Adafruit_Trellis matrix0 = Adafruit_Trellis();
add as many matrices as you like, each with a unique name, e.g.
Adafruit_Trellis matrix1 = Adafruit_Trellis();
Adafruit_Trellis matrix2 = Adafruit_Trellis();
etc...
Make a bigger set
Next we will make a set of matrices. Instead of
Adafruit_TrellisSet trellis = Adafruit_TrellisSet(&matrix0);
© Adafruit Industries https://learn.adafruit.com/adafruit-trellis-diy-open-source-led-keypad Page 15 of 27