#include "reg52.h"
sbit LED0=P2^0;
sbit LED1=P2^1;
sbit LED2=P2^2;
sbit LED3=P2^3;
sbit LED4=P2^4;
unsigned int x;
/****************************************************************
* 函 数 名 : Timer0Init
* 函数功能 : 定时器 0 初始化
*****************************************************************/
void Timer0Init()
{
TMOD|=0X01;//选择为定时器 0 模式, 工作方式 1, 仅用 TR0 打开启动。
TH0=0XEC; //给定时器赋初值, 定时 1ms
TL0=
51单片机中断定时2s实现流水灯
最新推荐文章于 2023-12-09 00:12:01 发布