#include #define uchar unsigned charsbit P13=P1^3;sbit P14=P1^4;uchar c,i,a=60,z;uchar code Numcode[]={0XC0,//;00XF9,//;10XA4,//;20XB0,//;30X99,//;40X92,//;50X82,//;60XF8,//;70X80,//;80X90,//;9};void delay(z){ while(z--);}void main(){TMOD=1;TH0=(65536-50000)/256;TL0=(65536-50000)%256;c=0;i=0;EA=1;ET0=1;TR0=1;while(1){ if(c==20){ c=0;a--;}if(a>=0){i=a/10;P13=1;P0=Numcode[i];P14=0;delay(20);P14=1;i=a%10;P0=Numcode[i];P13=0;delay(10);}else{a=60;}}}void timer0() interrupt 1{TH0=(65536-50000)/256;TL0=(65536-50000)%256;c++;}
評論