#include<reg52.h> // 这是下图的程序,可以仿真 试试
#define uchar unsigned char
#define uint unsigned int
uchar i,t;
uchar code table[]={0xf6,0xed,0xdb,0xf6,0xed,0xdb}; // 发光二极管循环点亮可以有很多方法
uchar code tabled[]={0xaa,0x55,0xaa,0x55,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay(uint z) // 延时程序
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void main()
{
t=30;
while(1)
{
t++;
if(t==100) t=10;
for(i=0;i<20;i++) // 发光二极管 循环亮
{
P1=tabled[i];
delay(250); // 调用延时程序
}
}
}
追问请问一下你这个程序循环两次在哪体现的呀