WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
程序代码:#include <reg51.h>
void delay2s()
{
unsigned char i;
TMOD=0x10;
for(i=0;i<20;i++)
{
TH1=0x3C;
TL1=0xAF;
TR1=1;
while(!TF1);
TF1=0;
}
}
void main()
{
while(1)
{
P1=0x01;
delay2s();
P1=0x02;
delay2s();
P1=0x04;
delay2s();
P1=0x08;
delay2s();
P1=0x10;
delay2s();
P1=0x20;
delay2s();
P1=0x40;
delay2s();
P1=0x80;
delay2s();
P1=0x06;
delay2s();
P1=0xC0;
delay2s();
P1=0x38;
delay2s();
P1=0xFF;
delay2s();
}
}做流水灯,用的着定时器吗?还是你想练习一下定时器?









