Skip to content
9Alpha edited this page Jun 1, 2015 · 4 revisions

This is only useful if you have a Trellis LED board. If you do not, then you only need the Processing side of the project.

TrellisTest_Modded

What it does

The TrellisTest code serves as the link between the second Arduino with the Trellis board (the big LED grid) and Processing. Because of the Arduino-Firmata library for Processing, we could directly link our other Arduino board to the Processing sketch. However, to properly use the Trellis board we had to use the Arduino-Trellis library. As this was not a standard Arduino library, it was not a part of the Firmata library. Thus, we had no means of controlling the Trellis directly from Processing.

How it works

When the program initializes, it saves the int value of each button as a two letter String. It then sticks this String in that button’s corresponding slot in a 64 spot String array.

When a button is pressed or released, another array (a 64 spot boolean array) is accessed. Here, the button’s slot in the boolean array is flipped whenever the button’s state (up or down) changes.

Lastly, each time the loop() method runs, a for loop runs through the boolean array. If any true values are found in the array, then the value in the same spot in the String array is printed to the Serial port.

Clone this wiki locally