// LedControl with button
#include <LedControl.h>
#define DIN 11
#define CLK 12
#define CS 10
#define ledmat 0
LedControl matice=LedControl (DIN, CLK, CS, ledmat);
int radek = 0;
int sloupec = 0;
void setup() {
pinMode(2, INPUT);
matice.shutdown (ledmat, false);
matice.setIntensity(ledmat, 8);
matice.clearDisplay(ledmat);
}
void loop() {
if (digitalRead(2)==HIGH){
radek++;
}
for (int i=0; i<=8; i++) {
matice.setLed (ledmat, i, radek, true);
delay(30);
matice.clearDisplay(ledmat);
}
}
while (radek >= 8) {
for (int o=0; o<=8; o++) {
matice.setLed (ledmat, sloupec, o, true);
delay(30);
matice.clearDisplay(ledmat);
}
sloupec++;
}
}