我的是8*8点阵,为什么我的中断没用啊,我用m设置中断的啊,要怎么样写才对的啊,为什么m不是=50ms的啊,主要是下面这一块,主函数里的,帮我看下了,谢谢
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
uchar code table1[]={0x00,0x00,0x02,0x03,0x02,0x00,0x00,0x00};
uchar code table2[]={0x00,0x00,0x04,0x06,0x04,0x00,0x00,0x00};
uchar code table3[]={0x00,0x00,0x08,0x0C,0x08,0x00,0x00,0x00};
uint t,m;
void delay(uint z)
{
while(z--);
}
void t0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
m++;
}
void display1()
{
uchar i;
for(i=0;i<8;i++)
{
P2=table;
P0=table1;
delay(2);
}
}
void display2()
{
uchar i;
for(i=0;i<8;i++)
{
P2=table;
P0=table2;
delay(2);
}
}
void main()
{
uint i;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
TR0=1;
ET0=1;
while(1)
{
for(m=0;m<2000;m++)
{
display1();
}
m=0;
for(m=0;m<2000;m++)
{
display2();
}
m=0;
}
}