#include <LedControl.h> //Import the library
/*PIN DI CONNESSIONE*/
#define PIN_DIN 11
#define PIN_CS 4
#define PIN_CLK 13
#define NUM_DISPLAY 1
int nLamp = 2;
/*ISTANZA DEL LED CONTROL*/
LedControl LC = LedControl(PIN_DIN, PIN_CLK, PIN_CS, NUM_DISPLAY);
void setup(){
for(int i = 0; i < nLamp; i++){
LC.shutdown(0, false);
delay(500);
for(int x = 2; x<6; x++){
LC.setLed(0, x, 0, true);
delay(500);
//FACE
for(int x = 2; x<6; x++){
LC.setLed(0, x, 0, true);
}
for(int x = 2; x<6; x++){
LC.setLed(0, x, 7, true);
}
for(int x = 2; x<6; x++){
LC.setLed(0, 0, x, true);
}
for(int x = 2; x<6; x++){
LC.setLed(0, 7, x, true);
}
LC.setLed(0, 1, 1, true);
LC.setLed(0, 1, 6, true);
LC.setLed(0, 6, 6, true);
LC.setLed(0, 6, 1, true);
for(int x = 3; x<5; x++){
LC.setLed(0, 5, x, true);
}
LC.setLed(0, 4, 2, true); //Angoli bocca
LC.setLed(0, 4, 5, true);
LC.setLed(0, 2, 2, true); //Occhi
LC.setLed(0, 2, 5, true);
}
}
}
void loop(){
delay(100);
}