#include <LedControl.h>
// LED matritsa uchun pinlar
int DIN = 12;
int CS = 11;
int CLK = 10;
LedControl lc = LedControl(DIN, CLK, CS, 0);
void setup() {
lc.shutdown(0, false); // LED matritsani yoqish
lc.setIntensity(0, 8); // Yorqinlik darajasi (0-15)
lc.clearDisplay(0); // Displeyni tozalash
}
void loop() {
// 8ta qator uchun diagonal ravishda LEDlarni yoqish
lc.setRow(0, 0, B10000000); // 1-qator: 0-o‘rindagi LEDni yoqish
lc.setRow(0, 1, B01000000); // 2-qator: 1-o‘rindagi LEDni yoqish
lc.setRow(0, 2, B00100000); // 3-qator: 2-o‘rindagi LEDni yoqish
lc.setRow(0, 3, B00010000); // 4-qator: 3-o‘rindagi LEDni yoqish
lc.setRow(0, 4, B00001000); // 5-qator: 4-o‘rindagi LEDni yoqish
lc.setRow(0, 5, B00000100); // 6-qator: 5-o‘rindagi LEDni yoqish
lc.setRow(0, 6, B00000010); // 7-qator: 6-o‘rindagi LEDni yoqish
lc.setRow(0, 7, B00000001); // 8-qator: 7-o‘rindagi LEDni yoqish
delay(500); // 500ms kutish
lc.clearDisplay(0); // Barcha LEDlarni o‘chirish
delay(500); // 500ms kutish
}