#include const int MATRIX_DIN = A0; const int MATRIX_CLK = A1; const int MATRIX_CS = A2; LedControl matrix = LedControl(MATRIX_DIN, MATRIX_CLK, MATRIX_CS, 1); int currentRow = 0; int currentCol = 0; unsigned long lastUpdate = 0; const int DELAY_MS = 150; // Скорость анимации void setup() { matrix.shutdown(0, false); matrix.setIntensity(0, 10); matrix.clearDisplay(0); } void loop() { // Обновляем анимацию только когда прошло нужное время if (millis() - lastUpdate >= DELAY_MS) { lastUpdate = millis(); // Очищаем матрицу перед новым кадром matrix.clearDisplay(0); // Включаем светодиод в текущей позиции matrix.setLed(0, currentRow, currentCol, true); // Переходим к следующей позиции currentCol++; if (currentCol >= 8) { currentCol = 0; currentRow++; if (currentRow >= 8) { currentRow = 0; } } } }