谢谢大佬回复,萌新第一次用这个点阵屏所以完全不懂代码如下#include<reg51.h>
#include<intrins.h>
#include<stdio.h>
#define uchar unsigned char
#define uint unsigned int
sbit RCK_PIN=P3^2;
char code DSY_CONTENT_8X8[]=
{
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xf7,0xe3,0x81,0x00,0xc3,0xc3,
0xc3,0xc3,0xc3,0xc3,0xc3,0xe7,0xe7,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff
};
uchar Scan_bit=0x01;
uchar Offset,Data_Index=0;
void Delay_MS(uint x)
{
uchar i;
while(--x)
for(i=0;i<120;i++);
}
void int0()interrupt 1
{
TH0=-1000/256;
TL0=-1000%256;
Scan_bit=_cror_(Scan_bit,1);
putchar(Scan_bit);
while(TI==0);
putchar(DSY_CONTENT_8X8[Offset+Data_Index+8]) ;
while(TI==0);
putchar(DSY_CONTENT_8X8[Offset+Data_Index]) ;
while(TI==0);
Data_Index=(Data_Index+1)%8;
RCK_PIN=1;
RCK_PIN=0;
}
void main()
{
TMOD=0X01;
IE=0X82;
TH0=-1000/256;
TL0=-1000%256;
TCON=0X00;
TI=1;
while(1)
{uchar i;
for(i=0;i<32;i++)
{Offset=i;
TR0=1;
Delay_MS(50);
TR0=0;
}
}
}现在主要不懂这个8*8点阵要怎么处理,接进去但是运行是接口是灰的不知道是什么情况 |