#include <LedControl.h>
int DIN = 12;
int CS = 11;
int CLK = 10;
LedControl lc=LedControl(DIN,CLK,CS,4);
void setup(){
lc.shutdown(0,false); //启动时,MAX72XX处于省电模式
lc.setIntensity(0,8); //将亮度设置为最大值
lc.clearDisplay(0); //清除显示
}
void loop(){
int b=0;
int s=0;
SetLed(7,2,0);
SetLed(7,15,0);
SetLed(12,2,0);
SetLed(12,15,0);
}
//点阵显示函数
void SetLed(int x,int y,int shape)
{
int tip=0;
x=x-1;
if(x<=7)
{
if(y<=7)
{
tip=1;
y=abs(8-y);
}
else if(y>7)
{
tip=0;
y=abs(y-16);
}
}
else if(x>7)
{
if(y<=7) tip=3;
else if(y>7)
{
tip=2;
x=abs(8-x);
}
}
lc.setLed(tip,x,y,true);
}