#include <stdio.h>
#include "pico/stdlib.h"
#include "ssd1306.h"
#include "menu.h"
#include "pong.h"
#include "joysticks.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
int selection = 1;
char command;
void setup_gpios(void) {
// prepare i2c
i2c_init(i2c_default, 100000);
gpio_set_function(PICO_DEFAULT_I2C_SDA_PIN, GPIO_FUNC_I2C);
gpio_set_function(PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C);
gpio_pull_up(PICO_DEFAULT_I2C_SDA_PIN);
gpio_pull_up(PICO_DEFAULT_I2C_SCL_PIN);
printf("READY\n");
}
int main() {
stdio_init_all();
setup_gpios();
// setup the oled display
ssd1306_t display;
ssd1306_init(&display, SCREEN_WIDTH, SCREEN_HEIGHT, 0x3C, i2c_default);
printf("Display initiated\n");
ssd1306_clear(&display);
// init_joysticks();
while (true) {
/*
get_joysticks();
print_joysticks();
command = joystick[0][2];
get_selection(command, selection);
*/
//display_menu(display, selection, 3);
pong(display);
sleep_ms(1000);
}
}