#include <REG2051.H>
#define uchar unsigned char
#define uint unsigned int
sbit LED = P1^0;
sbit LE = P1^1;
uchar T_Count = 0;
void main()
{
TMOD = 0x00;
TH0 = (8192-5000)/32;
TL0 = (8192-5000)%32;
IE = 0x82;
TR0 = 1;
while(1);
}
void LED_Flash() interrupt 1
{
TH0 = (8192-5000)/32;
TL0 = (8192-5000)%32;
if(++T_Count == 100)
{
LED = !LED;
LE=!LE ;
T_Count = 0;
}
}
此帖出自
小平头技术问答
为什么是8192 几位定时器啊
一周热门 更多>