#include #define uint unsigned int
#define uchar unsigned char
#define Key_state_0 0 //状态0 等待按键按下
#define Key_state_1 1 //状态1 判断是否为抖动,并且判断键值
#define Key_state_2 2 //状态3 等待按键松开
#define Key_input P3 //输出口
uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e}; //数码管段码
/***********延迟函数***********/
void Delay1ms(uint timee)//@11.0592MHz
{
unsigned char i, j;
for(;timee > 0; timee --)
{
_nop_();
_nop_();
_nop_();
i = 11;
j = 190;
do
{
while (--j);
} while (--i);
}
}
/***********定时器初始化函数****/
void Init_Timer0()
{
TMOD = 0x01; //定时器0设置模式为1
TH0 = (65535-10000)/256; //定时器0赋初值,定时时间为10000us
<