#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
#define p0 P0
#define p1 P1
#define p3 P3
#define p2 P2
uchar taba[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f};
uchar a,b,c,d,e,f,g,h,i,j,k,l;
void delaya();
void delay(unsigned int z)
{
while(z--);
}
void main()
{
TMOD=0x11; // 开启T0,T1
TH0=(65536-2000)/256;
TL0=(65536-2000)%256;
TH1=(65536-10000)/256;
TL1=(65536-10000)%256;
ET0=1; //
TR0=1;
ET1=1; //
TR1=1;
EA=1;
while(1)
{
delaya();
}
}
void li1() interrupt 1
{
TH0=(65536-2000)/256;
TL0=(65536-2000)%256;
i++;
if(i==5) i=0;j++;
if(j==16) j=0;
}
void li2() interrupt 3
{
TH1=(65536-10000)/256;
TL1=(65536-10000)%256;
h++;
if(h==50) h=0;e++;l++;
if(e==8) e=0;
if(l==16) l=0;
}
void delaya()
{
for(a=0;a<200;a++)
{
p0=0x01;
p1=0x01;
for(b=0;b<=8;b++)
{
p2=taba[15-j]; // j 在这里什么意思呢???
p0=_crol_(p0,1); //
p1=_crol_(p0,1);
delay(200);
}
}
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
谢谢啦谢谢啦
一周热门 更多>