Now buttons are assigned as how
many are going to be used,
how many in a row ,and
how many in a column Hope that not to confusing.
first part of the code example
#include <Keypad.h>
#include <Joystick.h>
//DEFINITIONS
#define ENABLE_PULLUPS
#define NUMROTARIES ? //replace "?" with number of rotary encoders you are using #define NUMBUTTONS ? //replace "?"with number of buttong you are using
#define NUMROWS ? //replace "?" with number of rows you have
#define NUMCOLS ? //replace "?" with number of columns you have
//BUTTON MATRIX
//first change number of rows and columns to match your button matrix,
//then replace all "?" with numbers (starting from 0)
byte buttons[NUMROWS][NUMCOLS] = {
{?,?,?,?},
{?,?,?,?},
{?,?,?,?},
{?,?,?,?}
};
Here is a video that I followed to run a Arduino Micro Pro for 32 buttons with 4 rotary encoders