源码:#include<reg51.h>void delay(){ int i,j; for(i=0;i<200;i++) for(j=0;j<500;j++);}void delay1(){ int i=10000; while(i--);}int i;void INT_0()interrupt 0{ EX0=0; delay1(); EX0=1; for(i=0;i<3;i++) { P2=0XFE; P1=0X0F; delay(); P2=0XFF; P1=0XfF; delay(); }}void main(){ EA=1; EX0=1; P2=0xff; while(1) { P1=0XFF; for(i=1;i<=15;i=2*i) { P1=P1-i; delay(); P1=0xff; } }}
|