Introducing Adafruit Trellis Created by lady ada Last updated on 2018-09-20 09:55:51 PM UTC
Guide Contents Guide Contents Overview Adding LEDs Connecting Library reference 2 3 7 13 14 Creating the objects Controlling LEDs 14 14 Reading Switches Adding support for more tiles Make more objects Make a bigger set Say the number 15 15 16 Tiling Addressing 17 22 (https://adafru.it/cZd)Changing Addresses Downloads Schematic Fabrication Print © Adafruit Industries 15 15 22 25 25 26 https://learn.adafruit.
Overview Trellis is an open source backlight keypad driver system. It is easy to use, works with any 3mm LEDs and eight tiles can be tiled together on a shared I2C bus. © Adafruit Industries https://learn.adafruit.
The Trellis PCB is specially made to match the Adafruit 4x4 elastomer keypad. Each Trellis PCB has 4x4 pads and 4x4 matching spots for 3mm LEDs. The circuitry on-board handles the background key-presses and LED lighting for the 4x4 tile. However, it does not have any microcontroller or other 'brains' - an Arduino (or similar microcontroller) is required to control the Trellis to read the keypress data and let it know when to light up LEDs as desired.
The tiles have 3 address jumpers. You can tile up to 8 PCBs together (for a total of 4x32 or 16x8=128 buttons/leds) on a single I2C bus, as long as each one has a unique address. All the tiles connect by the edges with solder, and share the same power, ground, interrupt, and i2c clock/data pins. So, you can easily set up to 128 LEDs and read up to 128 buttons using only 2 I2C wires! The tiles can be arranged in any configuration they want as long as each tile is connected to another with the 5 edge-fingers.
to be all blue, all red, etc. Mix it up! Any 3mm LED can be used, although we find that diffused LEDs with 250mcd+ brightness look best. © Adafruit Industries https://learn.adafruit.
Adding LEDs The Trellis PCB comes with all the driver circuitry but doesn't come with LEDs installed! This is because we know people want to get creative with the LED colors - choose any color you like! Diffused 3mm LEDs with 250mcd+ brightness look best. As you can see here, the LEDs sit inside the button cavity and the two button contacts surround it. This allows for the nice frosted LED effect.
LEDs have polarity so they have to be installed the right way or they won't work! There's a little + symbol on the left hand LED pads, thats the anode/positive pin. LEDs have a longer leg on the + pin so make sure that pin goes into the + hole. © Adafruit Industries https://learn.adafruit.
You can do one LED at a time, or all at once, its up to you and how experienced you are in soldering LEDs. Bend the LED legs out so that the LEDs sit nice and flat against the PCB. Flip over the PCB so you can solder them in Solder each and every LED leg. I like to do one LED at a time. © Adafruit Industries https://learn.adafruit.
Clip the legs about 2-3mm from the PCB so the leads aren't flying everywhere © Adafruit Industries https://learn.adafruit.
Keep soldering! © Adafruit Industries https://learn.adafruit.
Till you are done with all of them © Adafruit Industries https://learn.adafruit.
Connecting As shown here, Trellis is just an LED/keypad controller. You still need an Arduino or similar to do the work of reading the keypad data and then signifying when to light LEDs. Luckily, we wrote a library that handles all the hard work for you, making it all very easy! Download the Trellis Arduino library from our github repository (https://adafru.it/cZf) by clicking this shiny button https://adafru.it/cZg https://adafru.it/cZg Rename the uncompressed folder Adafruit_Trellis.
SCL goes to the I2C clock pin, on an Uno this is also known as A5 SDA goes to the I2C data pin, on an Uno this is also known as A4 We connect the INT interrupt pin to A2 - this pin isn't used in our demo code so you can leave it unconnected if you wish. Now open up the Arduino IDE and open up the File->Examples->Adafruit_Trellis->TrellisTest example sketch and upload it to your Arduino This sketch tests a single tile, with the default 0x70 address.
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.
update it to add up to 8 matrix names you defined. For example, 4 panels looks like: Adafruit_TrellisSet trellis = Adafruit_TrellisSet(&matrix0, &matrix1, &matrix2, &matrix3); Say the number Change this number from 1 to whatever # you are addressing // set to however many you're working with here, up to 8 #define NUMTRELLIS 1 Begin again Change the begin() call to add more addresses. Originally we only have the default 0x70 address: trellis.
Tiling You can tile up to eight Trellis PCBs on a single 2-wire I2C bus. This allows you to easily build up to 8x16 or 4x32 panels which can be lots of fun! To start with, its a good idea to assemble and test each individually so you know each Trellis works individually. © Adafruit Industries https://learn.adafruit.
There's little nubs on the sides of some PCBs that keep them on the assembly panel, you can file them off with any file or sandpaper. Arrange the tiles up the way you want, we'll start with two. Make sure the Adafruit logo is lined up the same. Solder two blobs of solder on two adjacent finger pads. © Adafruit Industries https://learn.adafruit.
Use your soldering iron to drag solder from one pad to another, with a little effort they'll stick together and make a connection. You can add more solder to make the connection stronger. Its still not mechanically strong - so be careful not to bend or shake the arrangement © Adafruit Industries https://learn.adafruit.
Repeat for the other 4 fingers © Adafruit Industries https://learn.adafruit.
Check that the panels are aligned by looking from the side, gently bend/reheat until they are nice and straight © Adafruit Industries https://learn.adafruit.
You can add a little more mechanical stability by soldering the large front tabs as well © Adafruit Industries https://learn.adafruit.
Repeat for up to 8 panels connected together, in any arrangement you like Addressing Each Trellis tile must have a unique address. You can set the addresses on the back of each panel using a little solder over the address jumpers. The HT16K33 driver chip on the Trellis has a default I2C address of 0x70.
If both A0 and A1 are shorted, the address is 0x73 If A2, A0 and A1 are shorted, the address is 0x77 © Adafruit Industries https://learn.adafruit.
Once you have set the unique addresses, you can set the addresses in the Arduino code, see the software page for details on how to do it. © Adafruit Industries https://learn.adafruit.
Downloads EagleCAD PCB and CAD files for the Trellis buttons and PCB from the github repo here (https://adafru.it/cZh) You can get the Arduino library for Trellis from the github repo here (https://adafru.it/cZf) Fritzing object in the Adafruit Fritzing library (https://adafru.it/aP3) Schematic © Adafruit Industries https://learn.adafruit.
Fabrication Print Dims in mm © Adafruit Industries Last Updated: 2018-09-20 09:55:50 PM UTC Page 27 of 27