#include #include "aa_final_font.h" #include #include #include #define PIN 2 #define NUMPIXELS 256 int brightnessValue = 20; const int matrixWidth = 8; const int matrixHeight = 8; const int tileWidth = 4; const int tileHeight = 1; Adafruit_NeoMatrix screen = Adafruit_NeoMatrix( matrixWidth, matrixHeight, tileWidth, tileHeight, PIN, NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_ROWS + NEO_TILE_PROGRESSIVE + NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE, NEO_GRBW + NEO_KHZ800); const uint16_t colors[] = { screen.Color(0, 0, 0), screen.Color( 100, 0, 100), screen.Color( 0, 100, 0), screen.Color( 100, 0, 0), }; enum colorName { BLACK, P_ONE, P_TWO, SYSTEM, }; String command; #include enum States { MODES, TIME, INCREMENT, MOVES, START, FIRST, GAME, END }; enum States state; int x = 0; int y = 0; pOneTEXT setCursor(uint16_t x0, uint16_t y0); void setTextColor(uint16_t P_ONE); pTwoTEXT setCursor(uint16_t x15, uint16_t y0); void setTextColor(uint16_t P_TWO); void setup() { CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0); Wire.begin(8); Wire.onReceive(receiveEvent); screen.begin(); screen.setBrightness(brightnessValue;); screen.clear(); screen.show(); color = BLACK; state = States::START; startRoutine(); state = States::MODES; } void loop() { Wire.onReceive(); String control; if (Wire.available()) { char c = Wire.read(); screen.setCursor(0, 0); screen..setTextColor(SYSTEM) screen.print(c); screen.show(); } void gameLoop() { } void startRoutine() { screen.clear(); if (Wire.available()) { char c = Wire.read(); screen.setCursor(0, 0); screen.setTextSize(1); screen.setTextColor(screen.Color(SYSTEM)); screen.print(c); screen.show() }