5 #include "seesaw_neopixel.h" 8 #define NEOKEY_1X4_ADDR 0x30 10 #define NEOKEY_1X4_NEOPIN 3 11 #define NEOKEY_1X4_BUTTONA 4 12 #define NEOKEY_1X4_BUTTONB 5 13 #define NEOKEY_1X4_BUTTONC 6 14 #define NEOKEY_1X4_BUTTOND 7 15 #define NEOKEY_1X4_BUTTONMASK ((1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)) 17 #define NEOKEY_1X4_ROWS 1 18 #define NEOKEY_1X4_COLS 4 19 #define NEOKEY_1X4_KEYS (NEOKEY_1X4_ROWS * NEOKEY_1X4_COLS) 21 #define NEOKEY_1X4_MAX_CALLBACKS 32 25 #define NEOKEY_1X4_KEY(x) (((x) / 8) * 4 + ((x) % 8)) 27 #define NEOKEY_1X4_X(k) ((k) % 4) 28 #define NEOKEY_1X4_Y(k) ((k) / 4) 30 #define NEOKEY_1X4_XY(x, y) ((y)*NEOKEY_1X4_ROWS + (x)) 32 typedef void (*NeoKey1x4Callback)(
keyEvent evt);
45 bool begin(uint8_t addr = NEOKEY_1X4_ADDR, int8_t flow = -1);
84 void setPixelColor(uint8_t x, uint8_t y, uint32_t color);
85 void setPixelColor(uint16_t num, uint32_t color);
uint8_t _rows
the number of trellis boards in the Y direction
Definition: Adafruit_NeoKey_1x4.h:91
uint8_t _addr
the I2C address of this board
Definition: Adafruit_NeoKey_1x4.h:59
uint8_t last_buttons
The last reading for the buttons.
Definition: Adafruit_NeoKey_1x4.h:58
Class that stores state and functions for interacting with the seesaw NeoKey module.
Definition: Adafruit_NeoKey_1x4.h:40
uint8_t _cols
the number of trellis boards in the X direction
Definition: Adafruit_NeoKey_1x4.h:92
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
NeoKey1x4Callback(* _callbacks[NEOKEY_1X4_KEYS])(keyEvent)
the array of callback functions
Definition: Adafruit_NeoKey_1x4.h:60
void unregisterCallback(uint8_t key)
unregister a callback on a given key
Definition: Adafruit_NeoKey_1x4.cpp:67
Definition: Adafruit_seesaw.h:212
Class that stores state and functions for interacting with multiple neotrellis boards.
Definition: Adafruit_NeoKey_1x4.h:70
Adafruit_NeoKey_1x4 * _neokeys
a multidimensional array of neokey objects
Definition: Adafruit_NeoKey_1x4.h:93
friend class Adafruit_MultiNeoKey1x4
Definition: Adafruit_NeoKey_1x4.h:54
bool begin(uint8_t addr=NEOKEY_1X4_ADDR, int8_t flow=-1)
Begin communication with the RGB trellis.
Definition: Adafruit_NeoKey_1x4.cpp:28
seesaw_NeoPixel pixels
the onboard neopixel matrix
Definition: Adafruit_NeoKey_1x4.h:52
Adafruit_NeoKey_1x4(uint8_t addr=NEOKEY_1X4_ADDR, TwoWire *i2c_bus=&Wire)
Class constructor.
Definition: Adafruit_NeoKey_1x4.cpp:10
void registerCallback(uint8_t key, NeoKey1x4Callback(*cb)(keyEvent))
register a callback function on the passed key.
Definition: Adafruit_NeoKey_1x4.cpp:56
uint8_t read(void)
Read key GPIO pins, possibly generating callback events.
Definition: Adafruit_NeoKey_1x4.cpp:77