⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd.lst

📁 数控电源的LCD菜单程序
💻 LST
📖 第 1 页 / 共 3 页
字号:
 535          {
 536   1       d7_8_10_11_13_14_16_17(i,'A',1);
 537   1      }
 538          void d11(void)
 539          {
 540   1       d7_8_10_11_13_14_16_17(v,'V',0);
 541   1      }
 542          void d12(void)
 543          {
 544   1       d9_12_15_18(i,i_new,'A');
 545   1       
 546   1      }
 547          //-------------------------------------------------------------------------
 548          void d13(void)
C51 COMPILER V7.06   LCD                                                                   09/14/2008 11:02:17 PAGE 10  

 549          {
 550   1       d7_8_10_11_13_14_16_17(p,'W',1);
 551   1      }
 552          void d14(void)
 553          {
 554   1       d7_8_10_11_13_14_16_17(p,'W',0);
 555   1      }
 556          void d15(void)
 557          {
 558   1       d9_12_15_18(p,p_new,'W');
 559   1      }
 560          //-------------------------------------------------------------------------
 561          void d16(void)
 562          {
 563   1       d7_8_10_11_13_14_16_17(t,'C',1);
 564   1      }
 565          void d17(void)
 566          {
 567   1       d7_8_10_11_13_14_16_17(t,'C',0);
 568   1      }
 569          void d18(void)
 570          {
 571   1       d9_12_15_18(t,t_new,'C');
 572   1      }
 573          void d19_26(uchar dis_num,uchar dis_num_new,uchar danwei)
 574          {
 575   1       print_num(0,6,dis_num,danwei,1);
 576   1       print_num(2,6,dis_num_new,danwei,1);
 577   1       
 578   1      }
 579          void d19(void)
 580          {
 581   1       if(++v_new==251)
 582   1       v_new=0;
 583   1          d19_26(v,v_new,'V');
 584   1      }
 585          void d20(void)
 586          {
 587   1          if(v_new==0)
 588   1       v_new=251;
 589   1       v_new--;
 590   1       
 591   1          d19_26(v,v_new,'V');
 592   1      }
 593          void d21(void)
 594          {
 595   1       if(++i_new==201)
 596   1       i_new=0;
 597   1          d19_26(i,i_new,'A');
 598   1      }
 599          void d22(void)
 600          {
 601   1          if(i_new==0)
 602   1       i_new=201;
 603   1       i_new--;
 604   1       d19_26(i,i_new,'A'); 
 605   1      }
 606          void d23(void)
 607          {
 608   1       if(++p_new==51)
 609   1       p_new=0;
 610   1       d19_26(p,p_new,'W');
C51 COMPILER V7.06   LCD                                                                   09/14/2008 11:02:17 PAGE 11  

 611   1      }
 612          void d24(void)
 613          {
 614   1       if(p_new==0)
 615   1       p_new=51;
 616   1       p_new--;
 617   1       d19_26(p,p_new,'W');
 618   1      }
 619          void d25(void)
 620          {
 621   1       if(++t_new==101)
 622   1       t_new=0;
 623   1       d19_26(t,t_new,'C');
 624   1      }
 625          void d26(void)
 626          {
 627   1          if(t_new==0)
 628   1       t_new=101;
 629   1       t_new--;
 630   1       d19_26(t,t_new,'C');
 631   1      }
 632          
 633          void d27(void)
 634          {
 635   1       dis_cls();
 636   1       delay(200);
*** WARNING C206 IN LINE 636 OF LCD.C: 'delay': missing function-prototype
*** ERROR C267 IN LINE 636 OF LCD.C: 'delay': requires ANSI-style prototype
 637   1      // dis_one_zi(0,0,x17,1,1);  //版本设计
 638   1      // dis_one_zi(0,1,x18,1,1);
 639   1      // dis_one_zi(2,0,x19,1,1); 
 640   1      // dis_one_zi(2,1,x20,1,1);
 641   1      
 642   1      }
 643          void d28(void)
 644          {
 645   1       dis_cls();
 646   1       dis_one_zi(1,2,x11,1,1);  //设置成功
 647   1       dis_one_zi(1,3,x12,1,1);
 648   1       dis_one_zi(1,4,x31,1,1); 
 649   1       dis_one_zi(1,5,x32,1,1);
 650   1       dis_one_char(1,12,'!',1);
 651   1       v=v_new;
 652   1       i=i_new;
 653   1       p_new=v*i;
 654   1       p=p_new;
 655   1       t=t_new;
 656   1       delay(1200);
 657   1       keyfuncindex=0;
 658   1       d0();
 659   1      }
 660          
 661          typedef struct
 662          {
 663           uchar keystateindex;
 664           uchar keydnstate;
 665           uchar keyupstate;
 666           uchar keycrstate;
 667           void(*currentoperate)();
 668          } kbdtabstruct;
 669          kbdtabstruct code keytab[size_of_keybd_menu]=
 670          { //第一行表示在0级菜单时按下向下键则转到1级菜单
C51 COMPILER V7.06   LCD                                                                   09/14/2008 11:02:17 PAGE 12  

 671            //按下向上键则转1级菜单,按下回车键则转5级菜单
 672            //    下 上 回车
 673           { 0, 0, 0, 1, (* d0)},
 674           { 1, 2, 6, 7, (* d1)},
 675           { 2, 3, 1,10, (* d2)},
 676           { 3, 4, 2,13, (* d3)},
 677           { 4, 5, 3,16, (* d4)},
 678           { 5, 6, 4,27, (* d5)},
 679           { 6, 1, 5, 0, (* d6)},
 680           { 7, 8, 7, 9, (* d7)},
 681           { 8, 8, 7, 1, (* d8)},
 682           { 9,20,19, 1, (* d9)},//电压调节
 683           {10,11,10,12, (*d10)},
 684           {11,11,10, 2, (*d11)},
 685           {12,22,21, 2, (*d12)},//电流调节
 686           {13,14,13,15, (*d13)},
 687           {14,14,13, 3, (*d14)},
 688           {15,24,23, 3, (*d15)},//功率调节
 689           {16,17,16,18, (*d16)},
 690           {17,17,16, 4, (*d17)},
 691           {18,26,25, 4, (*d18)},//温度调节
 692           
 693           {19,20,19,28, (*d19)},//V-up
 694           {20,20,19,28, (*d20)},//V-down
 695           {21,22,21,28, (*d21)},//I-up
 696           {22,22,21,28, (*d22)},//I-down
 697           {23,24,23,28, (*d23)},//P-up
 698           {24,24,23,28, (*d24)},//P-down
 699           {25,26,25,28, (*d25)},//T-up
 700           {26,26,25,28, (*d26)},//T-down
 701           {27, 5, 5, 5, (*d27)},//软件信息
 702           {28, 0, 0, 0, (*d28)} //设置成功
 703          };
 704          void getkeyinput(void)
 705          {
 706   1       uint counter=0;
*** ERROR C202 IN LINE 706 OF LCD.C: 'uint': undefined identifier
*** ERROR C141 IN LINE 706 OF LCD.C: syntax error near 'counter'
 707   1       uchar key_value;
*** ERROR C141 IN LINE 707 OF LCD.C: syntax error near 'unsigned'
*** ERROR C202 IN LINE 707 OF LCD.C: 'key_value': undefined identifier
 708   1      re: counter++;
*** ERROR C202 IN LINE 708 OF LCD.C: 'counter': undefined identifier
 709   1       P1=0xff;
 710   1       key_value=P1;
*** ERROR C202 IN LINE 710 OF LCD.C: 'key_value': undefined identifier
 711   1       if(key_value==0xff)
*** ERROR C202 IN LINE 711 OF LCD.C: 'key_value': undefined identifier
 712   1       {
 713   2        if(keyfuncindex>0 && keyfuncindex<28 && counter==4000)
*** ERROR C202 IN LINE 713 OF LCD.C: 'counter': undefined identifier
 714   2        {
 715   3         
 716   3         counter=0;
*** ERROR C202 IN LINE 716 OF LCD.C: 'counter': undefined identifier
 717   3         keyfuncindex=0;
 718   3         d0();
 719   3        }
 720   2        delay(1);
 721   2        goto re;
 722   2       }
 723   1      
C51 COMPILER V7.06   LCD                                                                   09/14/2008 11:02:17 PAGE 13  

 724   1          key_value=key_value&0xe0;
*** ERROR C202 IN LINE 724 OF LCD.C: 'key_value': undefined identifier
 725   1       delay(50);
 726   1       counter=0;
*** ERROR C202 IN LINE 726 OF LCD.C: 'counter': undefined identifier
 727   1       switch(key_value)
*** ERROR C202 IN LINE 727 OF LCD.C: 'key_value': undefined identifier
 728   1       {
 729   2        case 96:
 730   2        {
 731   3         keyfuncindex=keytab[keyfuncindex].keycrstate;
 732   3         break;
 733   3        }
 734   2        case 160:
 735   2        {
 736   3         keyfuncindex=keytab[keyfuncindex].keyupstate;
 737   3         break;
 738   3        }
 739   2        case 192:
 740   2        { 
 741   3         keyfuncindex=keytab[keyfuncindex].keydnstate;
 742   3         break;
 743   3        }
 744   2        default:
 745   2        goto re;
 746   2       }  
 747   1        
 748   1       keyfuncptr=keytab[keyfuncindex].currentoperate;
 749   1       (*keyfuncptr)();
 750   1       delay(150);
 751   1      }
 752          
 753          void sys_auto_check(void)
 754          {
 755   1       uchar xx,c=4;
 756   1       dis_one_zi(0,2,x33,1,1);
 757   1       dis_one_zi(0,3,x34,1,1);
 758   1       dis_one_zi(0,4,x35,1,1);
 759   1       dis_one_zi(0,5,x36,1,1);
 760   1      
 761   1       while(--c!=0)
 762   1       {
 763   2        for(xx=3;xx<13;xx++)
 764   2        {
 765   3         dis_one_char(2,xx-1,'>',1);
 766   3         dis_one_char(2,xx  ,'>',1);
 767   3         dis_one_char(2,xx+1,'>',1);
 768   3         delay(200);
 769   3         dis_one_char(2,xx-1,' ',1);
 770   3         dis_one_char(2,xx  ,' ',1);
 771   3         dis_one_char(2,xx+1,' ',1);
 772   3         }
 773   2       }
 774   1      }
 775          void main(void)
 776          {
 777   1       v=v_new=00;
 778   1       i=i_new=02;
 779   1       p=p_new=00;
 780   1       t=t_new=00;
 781   1       keyfuncindex=0;
 782   1       lcd_init();
C51 COMPILER V7.06   LCD                                                                   09/14/2008 11:02:17 PAGE 14  

 783   1          sys_auto_check();
 784   1       d0();
 785   1       while(1)
 786   1          getkeyinput();
 787   1      }

C51 COMPILATION COMPLETE.  4 WARNING(S),  13 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -