#include
unsigned char sx[]={
oxfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,
0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,
oxfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,
0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe,0x01},
ml[]={0xff,0x00, 0xff,0x00, 0xff,0x00,
0xff,0x00, 0xff,0x00, 0x01};
unsigned int a=0,b=0;
del1ms(unsigned int k)
{
unsigned int i,j;
for(i=0;i
}
main()
{
while(1)
{
if(sx[]!=0x01)
{
P0=sx[a];
del1ms(20);
a++;
}
else
a=0;
if(lm[]!=0x01)
{
P0=lm[b];
del1ms(30);
b++;
}
else
b=0;
}
}
说明一下: 这样延时太短了,基本上看不出
对于定义来说:变量只是一个标识符而已,随便设,当变量多 的时候最好用带意思如:sec stu 等
可以用多个delay延时子程序,延时多久你自己编。i,j随便用,定义为局部变量就不影响。提供电路、软件设计服务。延时子程序可采用定时器法和循环法,看你的需要!
delay1ms(10); //延时10毫秒
delay1ms(100); //延时100毫秒
.....
用一个带参数的延时子程序就行了阿