#include
unsigned char times;
sbit key=P1^0;
sbit led=P1^4;
void delay(unsigned char a)
{
unsigned char i,j;
for(i=0;ifor(j=0;j<120;j++);
}
main()
{
led=1;
while(1)
{
if(key==0)
{
while(key==0);
times++;
times%=3;
}
switch(times)
{
case 0:led=1;break;
case 1:led=0;break;
case 2:led=~led;delay(100);break;
default:break;
}
}
}
是需要程序吗?
什么语言?