📄 timer0.c
字号:
#include "Include.h"
void Timer0Init(void)
{
TCCR1B|=(1<<CS12);//选择输入时钟
TIMSK|=(1<<TOIE1);//开定时器1溢出中断
}
volatile unsigned char Timer=0;
//约1.5s中断一次
SIGNAL(SIG_OVERFLOW1)
{
if(Timer>0)
{
Timer--;
//LcdPrint(Timer);
}
//Timer测试
/*
{
static unsigned char i=1;
LedGreenOn(i);
i++;
if(i>9)
{
i=1;
}
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -