arduino MAX7219 8X8点阵
8X8点阵取模软件:
链接:https://pan.baidu.com/s/1FUrIOtabhWTaxhKu7-3IzA
提取码:4y1s
GND>>>>>>>>>>>GND
VCC>>>>>>>>>>>5V
DIN>>>>>>>>>>>>12
CS>>>>>>>>>>>>11
CLK>>>>>>>>>>>10
#include <LedControl.h>
int DIN = 12;
int CS = 11;
int CLK = 10;
byte smile[8]= {0x04,0x02,0x44,0x80,0x80,0x44,0x02,0x04};//利用字模软件取模
byte cry[8]={0x02,0x04,0x42,0x20,0x20,0x42,0x04,0x02};//字模软件在文章最上方
LedControl lc=LedControl(DIN,CLK,CS,4);
void printByte(byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]);
}
}
void setup(){
lc.shutdown(0,false); //启动时,MAX72XX处于省电模式
lc.setIntensity(0,8); //将亮度设置为最大值
lc.clearDisplay(0); //清除显示
}
void loop()
{
printByte(smile);//显示笑脸
delay(1000);//等待一秒
printByte(cry);//显示哭脸
delay(1000);//等待一秒
}