diff options
author | HombreLaser <buran@silosneeded.com> | 2024-06-22 11:01:41 -0600 |
---|---|---|
committer | HombreLaser <buran@silosneeded.com> | 2024-06-22 11:01:41 -0600 |
commit | 10ecf4d95194a273cc6aab89c3a1bcf739a194cd (patch) | |
tree | 9163b606ef00f7e0e147bb240a85032cea6026e2 /src/include/calculator.hpp | |
parent | 0ef2b4da78f51002bdf45ab632c97195ece9a8b7 (diff) |
Add tokenizer
Diffstat (limited to 'src/include/calculator.hpp')
-rw-r--r-- | src/include/calculator.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/calculator.hpp b/src/include/calculator.hpp new file mode 100644 index 0000000..8c5e97a --- /dev/null +++ b/src/include/calculator.hpp @@ -0,0 +1,32 @@ +#pragma once +#include "LCD_I2C.hpp" +#include "keypad.hpp" +#include "tokenizer.hpp" +#define LCD_COLUMNS 16 +#define LCD_ROWS 2 +#define I2C_ADDRESS 0x27 + +class Calculator { +private: + LCD_I2C *display; + Keypad *default_keypad; + Tokenizer tokenizer = Tokenizer(); + char default_keypad_chars[4][4] = { + {'1', '2', '3', '+'}, + {'4', '5', '6', '-'}, + {'7', '8', '9', '*'}, + {'(', '0', ')', '='} + }; + char secondary_keypad[4][4] = { + {'1', '2', '3', '+'}, + {'4', '5', '6', '-'}, + {'7', '8', '9', '/'}, + {'(', '0', ')', '='} + }; + uint keypad_col_pins[4] = {6, 7, 8, 9}; + uint keypad_row_pins[4] = {16, 17, 18, 19}; +public: + Calculator(); + ~Calculator(); + void run(); +}; |