#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// #include "Tetris.hpp"
#include "FlappyBird.hpp"
constexpr int8_t leftButton = 2;
constexpr int8_t rightButton = 3;
constexpr int8_t downButton = 4;
constexpr int8_t upButton = 5;
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// TetrisGame tetris(display, leftButton, rightButton, upButton, downButton);
FlappyBird flappy(display, upButton); // Assuming the flap button is connected to pin 2
void setup() {
Serial.begin(9600);
pinMode(leftButton, INPUT_PULLUP);
pinMode(rightButton, INPUT_PULLUP);
pinMode(upButton, INPUT_PULLUP);
pinMode(downButton, INPUT_PULLUP);
// tetris.setup();
flappy.setup();
}
void loop() {
// tetris.loop();
flappy.loop();
}
Loading
ssd1306
ssd1306