Class that stores state and functions for interacting with multiple neotrellis boards.
More...
#include <Adafruit_NeoKey_1x4.h>
|
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_NeoKey_1x4 * | _neokeys |
| a multidimensional array of neokey objects
|
|
Class that stores state and functions for interacting with multiple neotrellis boards.
◆ Adafruit_MultiNeoKey1x4()
Adafruit_MultiNeoKey1x4::Adafruit_MultiNeoKey1x4 |
( |
Adafruit_NeoKey_1x4 * |
neokeys, |
|
|
uint8_t |
rows, |
|
|
uint8_t |
cols |
|
) |
| |
class constructor
- Parameters
-
neokeys | pointer to a multidimensional array of Adafruit_NeoKey_1x4 objects. these object must have their I2C addresses specified in the class constructors. |
rows | the number of individual neokey boards in the Y direction of your matrix. |
cols | the number of individual neokey boards in the X direction of your matrix. |
◆ begin()
bool Adafruit_MultiNeoKey1x4::begin |
( |
| ) |
|
begin communication with the matrix of neotrellis boards.
- Returns
- true on success, false otherwise.
◆ registerCallback() [1/2]
void Adafruit_MultiNeoKey1x4::registerCallback |
( |
uint16_t |
num, |
|
|
NeoKey1x4Callback(*)(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_MultiNeoKey1x4::registerCallback |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
NeoKey1x4Callback(*)(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_MultiNeoKey1x4::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_MultiNeoKey1x4::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. |
◆ setPixelColor() [1/2]
void Adafruit_MultiNeoKey1x4::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_MultiNeoKey1x4::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: