1
附录 2
主程序
#include
#define uchar unsigned char
#define uint unsigned int
sbit KEYON =P2^0; // 开始键
sbit KEYOFF=P2^1; // 关闭键
sbit KEYSET=P2^2; // 预约键
sbit KEYINC=P2^3; // 加 1 键
sbit KEYDEC=P2^4; // 减 1键
sbit KEYFREE=P2^5; // 预留键
sbit POWER=P3^6; // 电源开关指示灯
sbit LED=P3^3 ; // 按键指示灯
uchar code dispcode[]={0x3f,0x06,0x05b,0x4f,0x66,
0x6d,0x7d,0x07,0x7f,0x6f,0x40}; // 0-9的字型码
uchar data