#include
***it LED1=P1^0;//定义引脚
***it LED2=P1^1;
***it key1=P0^0;
***it key2=P0^1;
void delay(unsigned int i){
while(i--);
}//设置延时函数
void main(){
while(1){
LED1=key1;//当开关按下时,电频触发为低电平,开关弹起时为高电频
LED2=key2;
delay(20000);
LED1=1;
LED2=1;
delay(20000);
}
}
#include
***it LED1=P1^0;//定义引脚
***it LED2=P1^1;
***it key1=P0^0;
***it key2=P0^1;
void delay(unsigned int i){
while(i--);
}//设置延时函数
void main(){
while(1){
LED1=key1;//当开关按下时,电频触发为低电平,开关弹起时为高电频
LED2=key2;
delay(20000);
LED1=1;
LED2=1;
delay(20000);
}
}
举报