#define Data P0 //数据端口 unsigned int hour
更新时间:2023-03-13 点击次数:次
#define Data P0 //数据端口 unsigned int hour,minute,second,count; sbit RS = P2^0;//Pin4 sbit RW = P2^1; //Pin5 sbit E = P2^2;//Pin6 char data TimeNum[]= ; char data Test1[]= ; bit flag=0,a=0; sbit eoc=P3^1; // 判断能否转换完毕 sbit oe=P3^3; // 判断能否答应输出端 sbit st=P3^0; // 启动 sbit clk=P3^5; // 时钟 sbit chanel=P3^4; //通道选择 //sbit P37=P3^7; ///////////// 第一个炉形态 sbit led0=P2^3; sbit led1=P2^4; sbit led2=P2^5; //////////// 第一个炉形态 sbit led3=P2^6; sbit led4=P2^7; sbit led5=P3^6; char table[]={0123456789}; char tab[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; //数码管 0~9 char scan[4]={0x01,0x02,0x04,0x08}; // 扫描信号 char disp[4]={0xc0,0xc0,0xc0,0xc0}; // 显示数组 char disp1[4]={0xc0,0xc0,0xc0,0xc0}; char scann=0; // 用于扫描的变量 char count1=0; //用于计数的变量 unsigned int temp; //用于转换的变量 unsigned int res; unsigned int stadc0808(); // 启动 AD0809 函数 unsigned int temp0,temp1,a1,a2; void delay(int); //延时函数 /******************************************************************/ /* 函数声明 */ /******************************************************************/ void DelayUs(unsigned char us)//delay us { unsigned char uscnt; uscnt=us
// 是第二行则号令代码高 4 位为 0xc else p=pos+0x80;//write command 16 WriteData (c);char *ptr) { unsigned char l,l=line=0x10) p=pos+0xb0;// 是第二行则号令代码高 4 位为 0x8 WriteCommand (p);i;//write data } /*************************************************************************/ void ShowString (unsigned char line,
1;/* Crystal frequency in 12MHz*/ 15 while(--uscnt); } /******************************************************************/ void DelayMs(unsigned char ms)//delay Ms { while(--ms) { DelayUs(250); DelayUs(250); DelayUs(250); DelayUs(250); } } void WriteCommand(unsigned char c) { DelayMs(5);//short delay before operation E=0; RS=0; RW=0; _nop_(); E=1; Data=c; E=0; } /****************************************************************/ void WriteData(unsigned char c) { DelayMs(5); //short delay before operation E=0; RS=1; RW=0; _nop_(); E=1; Data=c; E=0; RS=0; } /*********************************************************************/ void ShowChar(unsigned char pos,unsigned char c) { unsigned char p; if (pos