基于单片机的电子万年历的设计与制作 - 图文 联系客服

发布时间 : 星期四 文章基于单片机的电子万年历的设计与制作 - 图文更新完毕开始阅读46fa9556af45b307e971970f

郑州航空工业管理学院毕业设计(论文)

LCDSendWord(\开\ } if(mm==0) { LCDTestWord(0,0x8b); LCDSendWord(\关\ } } } }

void Key(void) {

if(SetKey==0) //设置时间 { delay(5);//按键消拌 if(SetKey==0&&w==0)//当是正常状态时就进入调时状态 { w=1;//进入调时的标志 SetTime(next);//调整时间 } if(SetKey==0&&w==1)//当是调时状态,本键用于 调整 下一页 { next++; if(next==15) { next=0; WriteCommandLCD(0x01); WriteCommandLCD(0x0c); } SetTime(next); } while(SetKey==0);//等待键松开 }

switch(next) //闪烁 { case 1:WriteCommandLCD(0x0f); //时闪烁 LCDTestWord(0,0x88); break; case 2:WriteCommandLCD(0x0f); LCDTestWord(0,0x8a); break; case 3:WriteCommandLCD(0x0f); LCDTestWord(0,0x85); break; case 4:WriteCommandLCD(0x0f); LCDTestWord(0,0x83); break; case 5:WriteCommandLCD(0x0f);

44

郑州航空工业管理学院毕业设计(论文)

LCDTestWord(0,0x92); break; case 6:WriteCommandLCD(0x0f); LCDTestWord(0,0x81); break; case 7:WriteCommandLCD(0x0f); LCDTestWord(0,0x8c); break; case 8:WriteCommandLCD(0x0f); LCDTestWord(0,0x92); break; case 9:WriteCommandLCD(0x0f); LCDTestWord(0,0x9a); break; case 10:WriteCommandLCD(0x0f); LCDTestWord(0,0x92); break; case 11:WriteCommandLCD(0x0f); LCDTestWord(0,0x94); break; case 12:WriteCommandLCD(0x0f); LCDTestWord(0,0x8b); break; }

if(SureKey==0)//当在调时状态时就退出调时 { delay(5); if(SureKey==0&&w==1) { //didi(); w=0; next=0; //退出按键 DS18B20Init(); //复位一下 TempWriteByte(Jump_Rom); //跳过ROM TempWriteByte(Write_Pad); //写暂存器 TempWriteByte(TH); TempWriteByte(TL); DS18B20Init(); //复位一下 TempWriteByte(Jump_Rom); //跳过ROM TempWriteByte(Copy_Pad); //暂存器内容copy至EEPROM WriteCommandLCD(0x01); WriteCommandLCD(0x0c); Holidays(); } while(SureKey==0); }

if(PlusKey==0) //++ { delay(5); if(PlusKey==0&&w==1)

45