#include<reg52.h> #define uint unsigned int sbit JD=P1^7; sbit GM=P1^6; void delay(uint z); main() { TMOD=0x10; EA=1; ET1=1; JD=0; GM=0; while(1) { if(JD= =1) { delay(3000); JD=0; } } } void counter1( ) interrupt 3 { if(GM==1) {JD=1;}} void delay(uint z) { uint x,y; for(x=110;x>0;x--) for(y=z;y>0;y--); }
|