51单片机+lcd12864液晶屏菜单程序
/*------------------------------------
Menu4按键音功能
------------------------------------*/
void Menu4_Pro()
{
if(!Again)
{
LCD_ClearGDRAM();
Again=1;
//Set_Speaker=0;
Refresh_SetTime=1;
LCD_WriteCommand(0x30);
LCD_WriteCommand(0x80);
LCD_SendString("按键音开关设置:");
LCD_WriteCommand(0x90);
LCD_SendString(" 开 关");
LCD_WriteCommand(0x98);
LCD_SendString("ENTER 键保存修改");
}
if(Refresh_SetTime)//当调节了刷新显示
{
Refresh_SetTime=0;
if(Set_Speaker)
{
LCD_WriteCommand(0x94);
LCD_DisplayCGRAM(1);
LCD_WriteCommand(0x90);
LCD_SendString(" ");
}
else
{
LCD_WriteCommand(0x90);
LCD_DisplayCGRAM(1);
LCD_WriteCommand(0x94);
LCD_SendString(" ");
}
}
if(!KEY_ENTER)
{
DelayMs(10);
if(!KEY_ENTER)
{
TR1=1;
while(!KEY_ENTER);
TR1=0;
if(Set_Speaker) ET1=0;
else ET1=1;
Enter_Menu=0;
Menu4=0;
guide_old++;
Again=0;
//guide=0;
LCD_ClearGDRAM();
}
}
}
/*------------------------------------
Menu5生日提醒功能
------------------------------------*/
void Menu5_Pro()
{
UINT16 temp;
LCD_ClearGDRAM();
LCD_WriteCommand(0x30);
LCD_WriteCommand(0x80);
LCD_SendString("距我生日还有:");
LCD_WriteCommand(0x88);
LCD_SendString("距洋洋生日还有:");
temp=Month/16;
Month=Month%16+temp*10;
temp=Date/16;
Date=Date%16+temp*10;
switch(Month)
{
case 1: temp=249-Date;break;
case 2: temp=218-Date;break;
case 3: temp=190-Date;break;
case 4: temp=159-Date;break;
case 5: temp=129-Date;break;
case 6: temp=98-Date;break;
case 7: temp=67-Date;break;
case 8: temp=37-Date;break;
case 9: if(Date<=6) temp=6-Date;
else temp=365-30+Date;break;
case 10:temp=(31-Date)+334;break;
case 12:temp=(30-Date)+304;break;
default: return;
}
if(!(Year%0x4))
temp+=1;
LCD_WriteCommand(0x06);
LCD_WriteCommand(0x90);
LCD_WriteData(temp/100|0x30);
LCD_WriteData(temp%100/10|0x30);
LCD_WriteData(temp%10|0x30);
temp+=12;
LCD_WriteCommand(0x98);
LCD_WriteData(temp/100|0x30);
LCD_WriteData(temp%100/10|0x30);
LCD_WriteData(temp%10|0x30);
LCD_WriteCommand(0x93);
LCD_SendString("天");
LCD_WriteCommand(0x9b);
LCD_SendString("天");
while(Menu5)
{
if(!KEY_ENTER)
{
DelayMs(10);
if(!KEY_ENTER)
{
TR1=1;
while(!KEY_ENTER);
TR1=0;
Menu5=0;
LCD_ClearGDRAM();
Enter_Menu=0;
guide_old++;
}
}
}
DS1302_ReadDate();
}
#endif
51单片机lcd12864液晶屏菜 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)