uchar xdata *calendar_address=0xFE00;//时钟地址外部数据存储器
/*******************************************************/
uchar calendar_time[7]={07,07,14,15,35,00,6}; /* 05/8/16 14:58:00 星期二 */
code uchar at[7]={9,8,7,4,2,0,6}; /* 年、月、日、时、分、秒 、星期*/
float ad[2]={0,0};//定义两个数组,保存电容计算时电压与电流值
uchar dat;
uchar d;
uchar x;
uchar m;

uchar temp;
uchar c1,c2,c3,,c5,c6;//用于打印测试电容
uchar autodat[6]={0x77,0x01,0x01,0x01,0x01,0x01};//自动显示
code uchar
dangwei[11][6]={{0x00,0x00,0x5B,0xFE,0x7E,0x7E},{0x00,0x30,0x7E,0xFE,0x7E,0x7E},
{0x00,0x30,0x5B,0xFE,0x7E,0x7E},{0x00,0x6D,0x7E,0xFE,0x7E,0x7E},
{0x00,0x6D,0x5B,0xFE,0x7E,0x7E},{0x00,0x79,0x7E,0xFE,0x7E,0x7E},
{0x00,0x33,0x7E,0xFE,0x7E,0x7E},
{0x00,0x5B,0x7E,0xFE,0x7E,0x7E},{0x00,0x70,0x7E,0xFE,0x7E,0x7E},
{0x00,0x7F,0x7E,0xFE,0x7E,0x7E},{0x30,0x7E,0x7E,0xFE,0x7E,0x7E}};//电容挡位设置
/*******************************************************/
//定义全局变量Key,用来保存按键值
/*
功能:ZLG7289 键盘中断服务程序
参数:
读到的键盘值放在全局变量Key 中
说明:
中断触发方式要设置成负边沿触发
*/
volatile unsigned char Key = 0xFF; //0xFF 表示未按键的状态
/***************************************************/
/*******************************************************************
void Set_calendar(void) //设置系统时间
{
unsigned char i;
REG_B=0x82; //关闭时钟
for(i=0;i<7;i++)
*(calendar_address+at[i])=calendar_time[i];//at[7]={9,8,7,4,2,0,6}; /*
年、月、日、时、分、秒 、星期calendar_time[7]={05,8,16,18,58,55,2}; 05/8/16 18:58:00 星期二
}
/***********************************************************************/
void setprint(void)
{
TMOD=0x20; // 定时器1工作于方式2
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-39167-35.html
暢暢等你周五的节目