Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use const for constructor's arguments.. #38

Open
arduino12 opened this issue Jun 28, 2021 · 0 comments
Open

Use const for constructor's arguments.. #38

arduino12 opened this issue Jun 28, 2021 · 0 comments

Comments

@arduino12
Copy link

It is better to change this line to:
Keypad(const char *userKeymap, const uint8_t *row, const uint8_t *col, uint8_t numRows, uint8_t numCols);

So the code can support:

const char KEYS[] = {
  '1','4','7','*',
  '2','5','8','0',
  '3','6','9','#',
  'A','B','C','D',
};

const uint8_t COLUMN_PINS[] = {9, 8, 7, 6};
const uint8_t ROW_PINS[] = {5, 4, 3, 2};

Keypad keypad = Keypad(KEYS, COLUMN_PINS, ROW_PINS, sizeof(ROW_PINS), sizeof(COLUMN_PINS));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant