Class that stores state and functions for interacting with multiple neotrellis boards.
More...
#include <Adafruit_NeoTrellis.h>
|
| Adafruit_MultiTrellis (Adafruit_NeoTrellis *trelli, uint8_t rows, uint8_t cols) |
| class constructor More...
|
|
bool | begin () |
| begin communication with the matrix of neotrellis boards. More...
|
|
void | registerCallback (uint16_t num, TrellisCallback(*cb)(keyEvent)) |
| register a callback for a key addressed by key number. More...
|
|
void | registerCallback (uint8_t x, uint8_t y, TrellisCallback(*cb)(keyEvent)) |
| register a callback for a key addressed by key index. More...
|
|
void | unregisterCallback (uint16_t num) |
| Unregister a callback for a key addressed by key number. More...
|
|
void | unregisterCallback (uint8_t x, uint8_t y) |
| Unregister a callback for a key addressed by key index. More...
|
|
void | activateKey (uint16_t num, uint8_t edge, bool enable=true) |
| Activate or deactivate a key by number. More...
|
|
void | activateKey (uint8_t x, uint8_t y, uint8_t edge, bool enable=true) |
| Activate or deactivate a key by number. More...
|
|
void | setPixelColor (uint8_t x, uint8_t y, uint32_t color) |
| set the color of a neopixel at a key index. More...
|
|
void | setPixelColor (uint16_t num, uint32_t color) |
| set the color of a neopixel at a key number. More...
|
|
void | show () |
| call show for all connected neotrellis boards to show all neopixels
|
|
void | read () |
| read all events currently stored in the seesaw fifo and call any callbacks.
|
|
|
uint8_t | _rows |
| the number of trellis boards in the Y direction
|
|
uint8_t | _cols |
| the number of trellis boards in the X direction
|
|
Adafruit_NeoTrellis * | _trelli |
| a multidimensional array of neotrellis objects
|
|
Class that stores state and functions for interacting with multiple neotrellis boards.
◆ Adafruit_MultiTrellis()
Adafruit_MultiTrellis::Adafruit_MultiTrellis |
( |
Adafruit_NeoTrellis * |
trelli, |
|
|
uint8_t |
rows, |
|
|
uint8_t |
cols |
|
) |
| |
class constructor
- Parameters
-
trelli | pointer to a multidimensional array of neotrellis objects. these object must have their I2C addresses specified in the class constructors. |
rows | the number of individual neotrellis boards in the Y direction of your matrix. |
cols | the number of individual neotrellis boards in the X direction of your matrix. |
◆ begin()
bool Adafruit_MultiTrellis::begin |
( |
| ) |
|
begin communication with the matrix of neotrellis boards.
- Returns
- true on success, false otherwise.
◆ registerCallback() [1/2]
void Adafruit_MultiTrellis::registerCallback |
( |
uint16_t |
num, |
|
|
TrellisCallback(*)(keyEvent) |
cb |
|
) |
| |
register a callback for a key addressed by key number.
- Parameters
-
num | the keynumber to set the color of. Key 0 is in the top left corner of the trellis matrix, key 1 is directly to the right of it, and the last key number is in the bottom righthand corner. |
cb | the function to be called when an event from the specified key is detected. |
◆ registerCallback() [2/2]
void Adafruit_MultiTrellis::registerCallback |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
TrellisCallback(*)(keyEvent) |
cb |
|
) |
| |
register a callback for a key addressed by key index.
- Parameters
-
x | the column index of the key. column 0 is on the lefthand side of the matix. |
y | the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards. |
cb | the function to be called when an event from the specified key is detected. |
◆ unregisterCallback() [1/2]
void Adafruit_MultiTrellis::unregisterCallback |
( |
uint16_t |
num | ) |
|
Unregister a callback for a key addressed by key number.
- Parameters
-
num | the keynumber to set the color of. Key 0 is in the top left corner of the trellis matrix, key 1 is directly to the right of it, and the last key number is in the bottom righthand corner. |
◆ unregisterCallback() [2/2]
void Adafruit_MultiTrellis::unregisterCallback |
( |
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
Unregister a callback for a key addressed by key index.
- Parameters
-
x | the column index of the key. column 0 is on the lefthand side of the matix. |
y | the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards. |
◆ activateKey() [1/2]
void Adafruit_MultiTrellis::activateKey |
( |
uint16_t |
num, |
|
|
uint8_t |
edge, |
|
|
bool |
enable = true |
|
) |
| |
Activate or deactivate a key by number.
- Parameters
-
num | the keynumber to set the color of. Key 0 is in the top left corner of the trellis matrix, key 1 is directly to the right of it, and the last key number is in the bottom righthand corner. |
edge | the edge that the key triggers an event on. Use SEESAW_KEYPAD_EDGE_FALLING or SEESAW_KEYPAD_EDGE_RISING. |
enable | pass true to enable the key on the passed edge, false to disable. |
◆ activateKey() [2/2]
void Adafruit_MultiTrellis::activateKey |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
edge, |
|
|
bool |
enable = true |
|
) |
| |
Activate or deactivate a key by number.
- Parameters
-
x | the column index of the key. column 0 is on the lefthand side of the matix. |
y | the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards. |
edge | the edge that the key triggers an event on. Use SEESAW_KEYPAD_EDGE_FALLING or SEESAW_KEYPAD_EDGE_RISING. |
enable | pass true to enable the key on the passed edge, false to disable. |
◆ setPixelColor() [1/2]
void Adafruit_MultiTrellis::setPixelColor |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint32_t |
color |
|
) |
| |
set the color of a neopixel at a key index.
- Parameters
-
x | the column index of the key. column 0 is on the lefthand side of the matix. |
y | the row index of the key. row 0 is at the top of the matrix and the numbers increase downwards. |
color | the color to set the pixel to. This is a 24 bit RGB value. for example, full brightness red would be 0xFF0000, and full brightness blue would be 0x0000FF. |
◆ setPixelColor() [2/2]
void Adafruit_MultiTrellis::setPixelColor |
( |
uint16_t |
num, |
|
|
uint32_t |
color |
|
) |
| |
set the color of a neopixel at a key number.
- Parameters
-
num | the keynumber to set the color of. Key 0 is in the top left corner of the trellis matrix, key 1 is directly to the right of it, and the last key number is in the bottom righthand corner. |
color | the color to set the pixel to. This is a 24 bit RGB value. for example, full brightness red would be 0xFF0000, and full brightness blue would be 0x0000FF. |
The documentation for this class was generated from the following files: