#include<reg52.h> sbit key1=P3^2; sbit key2=P3^3; sbit key3=P3^4; sbit key4=P3^5; sbit out1=P0^0; sbit out2=P0^1;
void delay(unsigned int cnt) { while(--cnt); }
main() {
P0=0xff; while(1) { {if(!key1) out1=0; out2=0;}问题:我想在此加入1S延时,使之在亮1S后为1,就是关闭? {if(!key2) out1=1;}
}
}
|