微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 基于C8051F的AD UART0 KEY FLASH TIME3程序

基于C8051F的AD UART0 KEY FLASH TIME3程序

时间:12-01 来源:互联网 点击:

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按下吗?上翻

{

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top