#include<reg52.h>
#include"74hc595.h"
#define uchar unsigned char
#define uint unsingned int
uchar sa[32]={0};
uchar sb[32]={0};
uchar sx=0,sy=0,num,sf=1,i,sl=1;
void main()
{
TMOD = 0x11; //设置定时器0的工作方式1
TH0 = ( 65535 - 50000 ) / 256;
TL0 = ( 65535 - 50000 ) % 256;
EA=1; //开总中断
ET0=1;
ET1=1;
TR1=1;
TR0=1;
while(1)
{
for(i=0;i<sl;i++)
showPoint(sa,sb,1);
sa[0]=sx;
}
}
void T0_time() interrupt 1
{
TH0 = ( 65535 - 50000 ) / 256; //定时器0重装初值
TL0 = ( 65535 - 50000 ) % 256;
num++;
if(num ==20) //如果到了20次,说明1m时间到
{
sx=5;
num = 0; //然后把num清0重新再计20次
}
}
就这么点代码 ,,,,,,,,,,,,,,sa[0]的值永远是0,,,,就是改不了!!!!!!!!!!火大我没办法了。。不用定时器了火大很。。。莫名的问题让人作呕!!!!!!!