diff options
Diffstat (limited to 'src/keypad.hpp')
-rw-r--r-- | src/keypad.hpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/keypad.hpp b/src/keypad.hpp new file mode 100644 index 0000000..8a99290 --- /dev/null +++ b/src/keypad.hpp @@ -0,0 +1,28 @@ +#include "pico/stdlib.h" +#define OUT true +#define IN false +#define KEYPAD_LEN 4 +#pragma once + +class Keypad { +private: + // Start private attributes. + uint *rows{}; + uint *cols{}; + char chars[4][4]; + // End private attributes. + + // Start private methods. + void initCharArray(char chars[4][4]); + void init(); + uint pressedColumn(); + void pullPinsDown(uint *pins); + void restartPins(); + // End private methods. +public: + // Start public methods. + Keypad(uint *rows, uint *cols, char chars[4][4]); + bool keyPressed(); + char getKey(); + // End public methods. +}; |