怎么感觉都没有什么新帖…………
我来冒个泡,虽然是很弱智的东西……
见谅,见谅……
渐渐地,渐渐地,人们就变得,
贱贱的,渐渐的………………
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
//预处理
uchar display[8];
uchar code table_id[40]={0x3c,0x3c,0x18,0x18,0x18,0x18,0x3c,0x3c,0x00,0x00,0x00,0x66,0xff,0xff,0xff,0x7e,0x3c,0x18,0x18,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x7e,0x3c,0x00,0x00};
//变量定义
void sinter()
{
IE=0x82;
TCON=0x01;
TH0=0xff;
TL0=0;
TR0=1;
}
void delay(uint z)
{
uchar j;
for(z;z>0;z--)
for(j=200;j>0;j--);
}
void rolldisplay()
{
uchar j;
char i,a;
for (i=7;i>-40;i--)
{
for (j=0;j<40;j++)
{
a=i+j;
if ((a>=0)&(a<8))
display[a]=table_id[j];
else
{
if (a>=8)
break;
}
}
delay(2);
}
delay(10);
}
void main(void)
{
sinter();
while(1)
{
rolldisplay();
}
}
void print(void) interrupt 1
{
uchar i,j,a;
P2=0;
for(i=0;i < 8;i++)
{
a=1<<i;
a=~a;
P1=a;
P0=display[i];
for(j=0;j<20;j++);
P0=0;
for(j=0;j<20;j++);
}
TH0=0xff;
TL0=0;
}