summaryrefslogtreecommitdiff
path: root/src/include/calculator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/calculator.hpp')
-rw-r--r--src/include/calculator.hpp32
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();
+};