-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bonk.ino
41 lines (37 loc) · 844 Bytes
/
Bonk.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <Arduino.h>
#include "src/Bonk.h"
#include <CircuitOS.h>
#include <Input/I2cExpander.h>
#include <Input/InputI2C.h>
#include <Loop/LoopManager.h>
#include <ArduinoJson.h>
#include <spiffs_api.h>
#include <gpio.h>
#include <avr/pgmspace.h>
#include "Nibble.hpp"
#include <Audio/Piezo.h>
Display display(128, 128, BL_PIN, 0);
I2cExpander i2c;
InputI2C buttons(&i2c);
Bonk::Bonk game(display);
void setup() {
gpio_init();
i2c.begin(0x74, 4, 5);
display.begin();
Serial.begin(115200);
Serial.println("BL on");
display.getBaseSprite()->clear(TFT_BLACK);
display.commit();
Serial.println("display ok");
Serial.println("buttons begin");
SPIFFS.begin();
LoopManager::addListener(&buttons);
Serial.println("spiffs begin");
Piezo.begin(BUZZ_PIN);
game.unpack();
game.start();
}
void loop() {
LoopManager::loop();
yield();
}