#include <LedControl.h>
//DIN, ClK, LOAD(CS), kiek monitoriu
LedControl lcd(2, 4, 3, 1);
int Y = 0;
void setup() {
 lcd.shutdown(0, false); // kuris monitorius, ar isjungt?
 lcd.setIntensity(0, 10); //kuris, lcd sviesumas
}

void loop() {
  //nuo ko pradeti; iki kiek testi; kaip keiciasi
  for(int X = 0; X <= 7; X += 1)
  {
   lcd.setLed(0, Y, X, true); //lempute ijungiama
   delay(200);
   lcd.setLed(0, Y, X - 2, false); //lempute isjungiama
  }
  Y += 1;  //monitorius, eilute, stulpelis, ar ijungt
  lcd.setLed(0, Y - 1, 6, false);
  lcd.setLed(0, Y - 1, 7, false);

  // ar uzejome uz ribu
  if (Y>= 8)
  {
    Y = 0;
    lcd.clearDisplay(0);
  }
  /*
lcd.setLed(0, 0, 7, false);
lcd.setLed(0, 0, 0, true);
delay(500);
lcd.setLed(0, 0, 0, false);
lcd.setLed(0, 0, 1, true);
delay(500);
lcd.setLed(0, 0, 1, false);
lcd.setLed(0, 0, 2, true);
delay(500);
lcd.setLed(0, 0, 2, false);
lcd.setLed(0, 0, 3, true);
delay(500);
lcd.setLed(0, 0, 3, false);
lcd.setLed(0, 0, 4, true);
delay(500);
lcd.setLed(0, 0, 4, false);
lcd.setLed(0, 0, 5, true);
delay(500);
lcd.setLed(0, 0, 5, false);
lcd.setLed(0, 0, 6, true);
delay(500);
lcd.setLed(0, 0, 6, false);
lcd.setLed(0, 0, 7, true);
*/
}