您好,这样:
P0=0x00;
if(a==20)
{
a=0;
P0=0x01;
}
如果你是要实现一秒钟亮,一秒钟灭,你可以这样
D=0x00;
while(1)
{
if(a==20)
{
a=0;
D=~D;
}
}其中D是led对应的一个io口(一定要先定义D)
楼上答案不对吧?