#include #include #include #define PIN 3 const int matrixWidth = 8; const int matrixHeight = 8; const int tileWidth = 4; const int tileHeight = 1; const int screenWidth = matrixWidth * tileWidth; const int screenHeight = matrixHeight * tileHeight; 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); void setup() { screen.begin(); screen.setBrightness(1); screen.clear(); screen.show(); startRoutine(); } int x = 0; int y = 0; void loop() { if (x < screenWidth) { x++; } else { y++; x = 0; if (y >= screenHeight) { y = 0; screen.clear(); screen.show(); } } screen.drawPixel(x, y, screen.Color(random(100, 255), random(100, 255), random(100, 255))); screen.show(); } void startRoutine() { screen.clear(); for (int i = 0; i < screenHeight; i++) { for (int k = 0; k < screenWidth; k += 2) { screen.drawPixel(k, i, screen.Color(255, 255, 255)); screen.show(); } } for (int i = 0; i < screenHeight; i++) { for (int k = 0; k < screenWidth; k += 2) { screen.drawPixel(k, i, screen.Color(0, 0, 0)); screen.show(); } } }