for£¨a=0£»a<•r(sh¨ª)ég/†Îλ•r(sh¨ª)ég£¬a++£©
delay100ms£¨£©£»
»òÕßdelay100ms£¨•r(sh¨ª)ég/†Îλ•r(sh¨ª)ég£©£»
void Timer0Init(void) //1ºÁÃë@11.0592MHz
{
AUXR |= 0x80; //¶¨•r(sh¨ª)Æ÷•r(sh¨ª)çŠ1Tģʽ
TMOD &= 0xF0; //ÔO(sh¨¨)Öö¨•r(sh¨ª)Æ÷ģʽ
TMOD |= 0x01; //ÔO(sh¨¨)Öö¨•r(sh¨ª)Æ÷ģʽ
TL0 = 0xCD; //ÔO(sh¨¨)Öö¨•r(sh¨ª)³õÖµ
TH0 = 0xD4; //ÔO(sh¨¨)Öö¨•r(sh¨ª)³õÖµ
TF0 = 0; //Çå³ýTF0˜Ë(bi¨¡o)Ö¾
TR0 = 1; //¶¨•r(sh¨ª)Æ÷0é_ʼӋ(j¨¬)•r(sh¨ª)
}
void Timer0Interrupt(void) interrupt 1 //1ms
{
a++;
}
main()
{
while(1){
if(a>=•r(sh¨ª)ég/†Îλ•r(sh¨ª)ég)
............
}