#include "reg52.h"
#define THCO 0xee
#define TLCO 0x0
sbit P24=P2^4;
void main()
{
TMOD=0x11; //设置定时器0工作模式
TH0=THCO;
TL0=TLCO;
TR0=1; //开定时器0
ET0=1;
EA=1;
while(1) ;
}
void timer0() interrupt 1 //定时器中断服务子程序
{
static unsigned char count=0;
TH0=THCO;
TL0=TLCO;
count++;
if(count> =200)
{
count=0;
P24=!P24;
}
}
重庆市优易特电子
联系人:行卫军
电话:023-62111023
网址: