#include <LedControl.h>
int DIN = 12;
int CS = 6;
int CLK = 10;
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
Wire.begin(8);
Wire.onReceive(receiveEvent);
Serial.begin(9600);
lc.shutdown(0,false);
lc.clearDisplay(0);
}
void loop(){
byte funcionando[8] = {0xff,0x81,0xbd,0xbd,0xbd,0xbd,0x81,0xff};
byte candado[8] = {0x00,0xf0,0xfe,0xf1,0xf1,0xfe,0xf0,0x00}; //candado
byte cruz[8] = {0xff,0x81,0xa5,0x99,0x99,0xa5,0x81,0xff};
delay(3000);
lc.setIntensity(0,5);
printByte(cruz); //Mostrar dibujo en hexadecimal
delay(3000);
lc.setIntensity(0,5);
printByte(funcionando); //Mostrar dibujo en hexadecimal
delay(3000);
lc.clearDisplay(0); //apagar todos los led de la matriz
lc.setLed(0,7,0,true); //Encendemos un led individualmente (x(7),y(0))
delay(3000);
lc.setLed(0,7,0,false); //Apagamos un led individualmente (x(7),y(0))
}
//-------------------------------------------------------------------------
void printByte(byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]);
}
}
//-------------------------------------------------------------------------