一、LED点阵屏
1.配置跳线帽:
GP595:插上
GGOE:插在右边两个排针上
2.开发板引脚对应关系
![](https://img-blog.csdnimg.cn/direct/e87c89e694a848c5b82fb8dfaf2dab15.png)
二、代码示例
1.把数据按位次存进寄存器
void _74HC595_WriteByte(unsigned char Byte)
{
unsigned char i;
for(o=0;i<8;i++)
{
SER=Byte&(0x80>>i);
SCK=1;
SCK=0;
}
RCK=1;
RCK=0;
}
2.选中对应的行
void MatrixLED_ShowColumn(unsigned char Column,Data)
{
_74HC595_WriteByte(Date);
P0=~(0x80>>Column);
}
3.初始化:
void MatrixLED_Init()
{
SCK=0;
RCK=0;
}
4.动画:
unsigned char animation[]={}
void main()
{
unsigned char i,Offset=0,Count=0;
MatrixLED_Init();
while(1)
{
for(i=0;i<8;i++)
{
MatrixLED_ShowColumn(i,animation[i+Offset]);
}
Count++;
if(Count>10)
{
Count=0;
Offset++:
}
}
}