#include <Keypad.h>
#include "tictactoe.h"
const int ROWS = 4;
const int COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {13, 12, 14, 27};
byte colPins[COLS] = {26, 25, 33, 32};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
const int SCREEN_WIDTH = 128;
const int SCREEN_HEIGHT = 64;
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
TicTacToe game;
void setup() {
Serial.begin(9600);
game.setupOled(oled);
}
void loop() {
char key = keypad.getKey();
if(key != NO_KEY) {
game.pressKey(key);
}
}