按键外部中断,触发一次全局变量+1,点亮就是加一
#includesbit key=P1^0;main(){unsigned char led;led=0xfe;while(1) { if(key==0) { while(key==0); P0=led; if(led==0x00)led=0xff; led<<=1; } }}