// This file turn single leds on rows at the 8x8 DotMatrix
// connect CS --> D10, CLK --> D11, DIN --> D12
// on this site you can drow any thing you want to display
// http://xantorohara.github.io/led-matrix-editor/
// -----------------------------------------------------------------
#include <LedControl.h>
LedControl lc=LedControl(12,11,10,1);
int i, delaytime=500;
byte SadSmile[8]=
{
0b00000000,
0b01100110,
0b01100110,
0b00000000,
0b00011000,
0b00100100,
0b01000010,
0b01000010,
};
// byte EmptyHeart[8]={B01100110,B10011001,B10000001,B10000001,
// B01000010,B00100100,B00011000,B00000000 };
byte HappySmile[8]=
{
0b00000000,
0b01100110,
0b01100110,
0b00000000,
0b01000010,
0b01000010,
0b00100100,
0b00011000
};
void setup()
{
//The MAX72XX is in power-saving mode on startup,
lc.shutdown(0,false); // wakeup The MAX7219
lc.setIntensity(0,8); // Set brightness to a medium value
lc.clearDisplay(0); // Clear the display
}
void loop()
{
for(i=0; i<8; i++)
lc.setRow(0,i,SadSmile[i]);
delay(delaytime);
for(i=0; i<8; i++)
lc.setRow(0,i,HappySmile[i]);
delay(delaytime);
}