基于C8051F的AD UART0 KEY FLASH TIME3程序
if(BGset>
if(k>
if(Page>
if(!(Mkey&0x08)) //SW5按下吗?右移->
if(direction >
if(keybuffer[0]>
fer[0] = 11;
}
}
}
if(Tset < 4)
{
TH = keybuffer[0]/10;
TL = keybuffer[0]%10;
number_disp (1,0,0x91,1,TAB[TH],TAB[TL]);
}
if(Tset>4)
{
number_disp (1,0,0x91,1,0x20,0x20);
}
}break;
case 2:
{
TH = keybuffer[0]/10;
TL = keybuffer[0]%10;
number_disp (1,0,0x91,1,TAB[TH],TAB[TL]);
if(!(P4&0x40)) //SW2按下吗?下翻
{
delayms(200);
if(!(P4&0x40))
{
BGset =2;
keybuffer[1]++;
if(keybuffer[1]>12) //月设置,不超过12月
{
keybuffer[1] = 1;
}
}
}
if(!(P4&0x20)) //SW3按下吗?上翻
{
delayms(200);
if(!(P4&0x20))
{
BGset =2;
keybuffer[1]--;
if(keybuffer[1]<1) //小于1 显示12月
{
keybuffer[1] = 12;
}
}
}
if(Tset < 4)
{
TH = keybuffer[1]/10;
TL = keybuffer[1]%10;
number_disp (1,0,0x93,1,TAB[TH],TAB[TL]);
}
if(Tset>4)
{
number_disp (1,0,0x93,1,0x20,0x20);
}
}break;
case 3:
{
TH = keybuffer[1]/10;
TL = keybuffer[1]%10;
number_disp (1,0,0x93,1,TAB[TH],TAB[TL]);
if(!(P4&0x40)) //SW2按下吗?下翻
{
delayms(200);
if(!(P4&0x40))
{
BGset =2;
keybuffer[2]++;
if(keybuffer[2]>31) //日设置,不超过31日
{
keybuffer[2] = 1;
}
}
}
if(!(P4&0x20)) //SW3按下吗?上翻
{
delayms(200);
if(!(P4&0x20))
{
BGset =2;
keybuffer[2]--;
if(keybuffer[2]<1) //小于1,显示31日
{
keybuffer[2] = 31;
}
}
}
if(Tset<4)
{
TH = keybuffer[2]/10;
TL = keybuffer[2]%10;
number_disp (1,0,0x95,1,TAB[TH],TAB[TL]);
}
if(Tset>4)
{
number_disp (1,0,0x95,1,0x20,0x20);
}
}break;
case 4:
{
TH = keybuffer[2]/10;
TL = keybuffer[2]%10;
number_disp (1,0,0x95,1,TAB[TH],TAB[TL]);
if(!(P4&0x40)) //SW2按下吗?下翻
{
delayms(200);
if(!(P4&0x40))
{
BGset =2;
keybuffer[3]++;
if(keybuffer[3]>23) //时设置,不超过24
{
keybuffer[3] = 0;
}
}
}
if(!(P4&0x20)) //SW3按下吗?上翻
{
delayms(200);
if(!(P4&0x20))
{
BGset =2;
keybuffer[3]--;
if(keybuffer[3]<=0) //小于1,显示23
{
keybuffer[3] = 23;
}
}
}
if(Tset < 4)
{
TH = keybuffer[3]/10;
TL = keybuffer[3]%10;
number_disp (0,1,0x85,1,TAB[TH],TAB[TL]);
}
if(Tset>4)
{
number_disp (0,1,0x85,1,0x20,0x20);
}
}break;
case 5:
{
TH = keybuffer[3]/10;
TL = keybuffer[3]%10;
number_disp (0,1,0x85,1,TAB[TH],TAB[TL]);
if(!(P4&0x40)) //SW2按下吗?下翻
{
delayms(200);
if(!(P4&0x40))
{
BGset =2;
keybuffer[4]++;
if(keybuffer[4]>59) //分设置,不超过59
{
keybuffer[4] = 0;
}
}
}
if(!(P4&0x20)) //SW3按下吗?上翻
{
delayms(200);
if(!(P4&0x20))
{
BGset =2;
keybuffer[4]--;
if(keybuffer[4]<=0) //小于1,显示59
{
keybuffer[4] = 59;
}
}
}
if(Tset < 4)
{
TH = keybuffer[4]/10;
TL = keybuffer[4]%10;
number_disp (0,1,0x87,1,TAB[TH],TAB[TL]);
}
if(Tset>4)
{
number_disp (0,1,0x87,1,0x20,0x20);
}
}break;
case 6:
{
TH = keybuffer[4]/10;
TL = keybuffer[4]%10;
number_disp (0,1,0x87,1,TAB[TH],TAB[TL]);
if(!(P4&0x40)) //SW2按下吗?下翻
{
delayms(200);
if(!(P4&0x40))
{
BGset = 2;
keybuffer[5]++;
if(keybuffer[5]>59) //时设置,不超过24
{
keybuffer[5] = 0;
}
}
}
if(!(P4&0x20)) //SW3按下吗?上翻
{
C8051FADUART0TIME 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)