////////////菜单切换及选择/////////////////////////////////////////////////////////////////////////////////////////////////////////////// while(1){ button(); //按键扫描 if(n1==0){ // 返回/上 n4=n4-1; if(n4<0) { n4=11; } if(n4<=3) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu[i]); } } //菜单选择 if(n4>3 & n4<=7) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu1[i]); } } if(n4>7) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu2[i]); } } // if(n4<=3) { LcmClearTXT(); highlight(0,liney,8,0); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu[i]); } } // if(n4>3 & n4<=7) { LcmClearTXT(); highlight(0,liney,8,0); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu1[i]); } } // if(n4>7) { LcmClearTXT(); highlight(0,liney,8,0); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu2[i]); } } if(n4==0 | n4==4 | n4==8 ){ liney=0; } //光标位置 if(n4==1 | n4==5 | n4==9 ){ liney=1; } if(n4==2 | n4==6 | n4==10 ){ liney=2; } if(n4==3 | n4==7 | n4==11 ){ liney=3; } highlight(0,liney,8,255); //放置光标 } if(n2==0){ // 下 n4=n4+1; if(n4>11) { n4=0; } if(n4<=3) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu[i]); } } if(n4>3 & n4<=7) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu1[i]); } } if(n4>7) { LcmClearTXT(); LcmClearBMP(); for(i=0;i < 4;i++){ LCD_ShowString(i,0,menu2[i]); } } if(n4==0 | n4==4 | n4==8 ){ liney=0; } if(n4==1 | n4==5 | n4==9 ){ liney=1; } if(n4==2 | n4==6 | n4==10 ){ liney=2; } if(n4==3 | n4==7 | n4==11 ){ liney=3; } highlight(0,liney,8,255); //放置光标 } if(n3==0){ // 确认 if(n4==0) { LcmClearBMP(); LcmClearTXT(); goto HB;} if(n4==1) { LcmClearBMP(); LcmClearTXT(); goto HC;} if(n4==2) { LcmClearBMP(); LcmClearTXT(); goto HD;} if(n4==3) { LcmClearBMP(); LcmClearTXT(); goto HE;} if(n4==4) { LcmClearBMP(); LcmClearTXT(); goto HF;} if(n4==5) { LcmClearBMP(); LcmClearTXT(); goto HG;} if(n4==6) { LcmClearBMP(); LcmClearTXT(); goto HH;} if(n4==7) { LcmClearBMP(); LcmClearTXT(); goto HI;} if(n4==8) { LcmClearBMP(); LcmClearTXT(); goto HJ;} if(n4==9) { LcmClearBMP(); LcmClearTXT(); goto HK;} if(n4==10){ LcmClearBMP(); LcmClearTXT(); goto HL;} if(n4==11){ LcmClearBMP(); LcmClearTXT(); goto HM;} } |