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

📄 text1.lst

📁 本程序能实现温度的实时采集与显示
💻 LST
📖 第 1 页 / 共 5 页
字号:
 510   2                                      cha[3]=inttochar(da2);
 511   2                                      cha[4]='.';
 512   2                                      cha[5]=inttochar(w1);
 513   2                                      cha[6]='\0';                            
 514   2      printf("%s\n",cha);                     
 515   2      //fa2=atof(cha);
 516   2      
 517   2                                      for(j=1;j<=5;j++)
 518   2                                              {
 519   3                                              for(i=1;i<=200;i++)
 520   3                                                      Delay_Count(255);
 521   3                                              }
 522   2      
 523   2      
 524   2      //  s=1;
 525   2      //   WRCommand(0x01);   //清除显示DDRAM
 526   2         ShowQQChar(0x9B,cha,3);
 527   2      ShowQQChar(0x9E,chinese11,lengthCF11);
 528   2         if (enter==0)
 529   2                      break;
 530   2              }
 531   1      }
*** WARNING C280 IN LINE 477 OF TEXT1.C: 'fa1': unreferenced local variable
*** WARNING C280 IN LINE 477 OF TEXT1.C: 'fa2': unreferenced local variable
*** WARNING C280 IN LINE 477 OF TEXT1.C: 'fa3': unreferenced local variable
 532          //温度显示结束
 533          
 534          void firstscreen(void)
 535          {
 536   1      //一屏
 537   1        s=1;
 538   1         WRCommand(0x01);     //清除显示DDRAM
 539   1         ShowQQChar(0x80,chinese1,lengthCF1);
 540   1         ShowQQChar(0x90,chinese2,lengthCF2);
 541   1         ShowQQChar(0x88,chinese3,lengthCF3);
 542   1         ShowQQChar(0x98,chinese4,lengthCF4);
 543   1         temp();
 544   1         WaitNms(250);                //等待时间
 545   1         WaitNms(250);
 546   1       //等待时间
 547   1      
 548   1      }
C51 COMPILER V7.06   TEXT1                                                                 11/05/2007 16:26:34 PAGE 10  

 549          
 550          void pHsecondscreen(void)
 551          {
 552   1      //二屏
 553   1         s=2;
 554   1         LCDInit();
 555   1         RDBF();
 556   1         WRCommand(0x01);     //清除显示DDRAM
 557   1         ShowQQChar(0x80,chinese5,lengthCF5);
 558   1         ShowQQChar(0x87,chinese1,lengthCF1);
 559   1         ShowQQChar(0x90,chinese6,lengthCF6);
 560   1         ShowQQChar(0x88,chinese7,lengthCF7);
 561   1         ShowQQChar(0x98,chinese8,lengthCF8);
 562   1         WaitNms(250);                //等待时间
 563   1         WaitNms(250);                //等待时间
 564   1      
 565   1      }
 566          
 567          void DOsecondscreen(void)
 568          {
 569   1      //二屏
 570   1         s=3;
 571   1         LCDInit();
 572   1         RDBF();
 573   1         WRCommand(0x01);     //清除显示DDRAM
 574   1         //ShowQQChar(0x80,chinese5,lengthCF5);
 575   1         ShowQQChar(0x87,chinese2,lengthCF2);
 576   1         ShowQQChar(0x90,chinese5,lengthCF5);
 577   1         ShowQQChar(0x88,chinese9,lengthCF9);
 578   1         ShowQQChar(0x98,chinese8,lengthCF8);
 579   1         WaitNms(250);                //等待时间
 580   1         WaitNms(250);                //等待时间
 581   1      
 582   1      }
 583          
 584          void Fsecondscreen(void)
 585          {
 586   1      //二屏
 587   1         s=4;
 588   1         LCDInit();
 589   1         RDBF();
 590   1         WRCommand(0x01);     //清除显示DDRAM
 591   1         //ShowQQChar(0x80,chinese5,lengthCF5);
 592   1         ShowQQChar(0x87,chinese3,lengthCF3);
 593   1         ShowQQChar(0x90,chinese5,lengthCF5);
 594   1         ShowQQChar(0x88,chinese9,lengthCF9);
 595   1         ShowQQChar(0x98,chinese8,lengthCF8);
 596   1         WaitNms(250);                //等待时间
 597   1         WaitNms(250);                //等待时间
 598   1      
 599   1      }
 600          
 601          void Tsecondscreen(void)
 602          {
 603   1      //二屏
 604   1         s=5;
 605   1         LCDInit();
 606   1         RDBF();
 607   1         WRCommand(0x01);     //清除显示DDRAM
 608   1         //ShowQQChar(0x80,chinese5,lengthCF5);
 609   1         ShowQQChar(0x87,chinese4,lengthCF4);
 610   1         ShowQQChar(0x88,chinese10,lengthCF10);
C51 COMPILER V7.06   TEXT1                                                                 11/05/2007 16:26:34 PAGE 11  

 611   1         temp();  
 612   1         //ShowQQChar(0x88,chinese9,lengthCF9);
 613   1         ShowQQChar(0x98,chinese8,lengthCF8);
 614   1         WaitNms(250);                //等待时间
 615   1         WaitNms(250);                //等待时间
 616   1      
 617   1      }
 618          
 619          
 620          //主函数
 621          void main(void)
 622          {
 623   1      unsigned char cha[4];
 624   1      //ph=12.45;
 625   1      //sprintf(sph,"%5.2f",ph);
 626   1       autobaud();
 627   1      //printf("OK");
 628   1         //printf("%s",sph);
 629   1        LCDInit();
 630   1      RDBF();
 631   1       // printf("已调用完判忙函数\r\n");
 632   1      
 633   1      
 634   1      WRCommand(0x01);        //清除显示DDRAM
 635   1        // ShowQQChar(0x80,sph,3);
 636   1       printf("已调用完判忙函数\r\n");
 637   1       
 638   1       firstscreen();
 639   1      
 640   1      
 641   1                 b=4;
 642   1      while(1)
 643   1              {
 644   2              if(up==0 && b==4)
 645   2                  { WaitNms(250);
 646   3              WaitNms(250);
 647   3              WaitNms(250);
 648   3              
 649   3                      WRCommand(0x88);
 650   3                     b=3;
 651   3                   }
 652   2              if(down==0&& b==4)
 653   2                     {WaitNms(250);
 654   3              WaitNms(250);
 655   3              WaitNms(250);
 656   3              
 657   3                         WRCommand(0x80);
 658   3                      b=1;
 659   3                   }
 660   2                 
 661   2              if(up==0 && b==3)
 662   2                 {WaitNms(250);
 663   3              WaitNms(250);
 664   3              WaitNms(250);
 665   3              
 666   3                 WRCommand(0x90);
 667   3                     b=2;
 668   3                    }
 669   2              if(down==0 && b==3)
 670   2                     {WaitNms(250);
 671   3              WaitNms(250);
 672   3              WaitNms(250);
C51 COMPILER V7.06   TEXT1                                                                 11/05/2007 16:26:34 PAGE 12  

 673   3              
 674   3                         WRCommand(0x98);
 675   3                      b=4;
 676   3                  }
 677   2              if(up==0 && b==2)
 678   2                 {WaitNms(250);
 679   3              WaitNms(250);
 680   3              WaitNms(250);
 681   3              
 682   3                  WRCommand(0x80);
 683   3              
 684   3                     b=1;
 685   3                   }
 686   2              if(down==0 && b==2)
 687   2                     {WaitNms(250);
 688   3              WaitNms(250);
 689   3              WaitNms(250);
 690   3              
 691   3                         WRCommand(0x88);
 692   3                      b=3;
 693   3                  }
 694   2              if(up==0 && b==1)
 695   2                 {WaitNms(250);
 696   3              WaitNms(250);
 697   3              WaitNms(250);
 698   3              
 699   3                  WRCommand(0x98);
 700   3              
 701   3                     b=4;
 702   3                    }
 703   2              if(down==0 && b==1)
 704   2                  { WaitNms(250);
 705   3              WaitNms(250);
 706   3              WaitNms(250);
 707   3                    WRCommand(0x90);
 708   3                      b=2;
 709   3                  }
 710   2              
 711   2              if(enter==0 && b==1 && s==1)
 712   2                 { WaitNms(250);
 713   3                 pHsecondscreen();
 714   3                    b=4;}
 715   2              if(enter==0 && b==2 && s==1)
 716   2                 { WaitNms(250);
 717   3                 DOsecondscreen();
 718   3                    b=4;}
 719   2              
 720   2              if(enter==0 && b==3 && s==1)
 721   2                 { WaitNms(250);
 722   3                 Fsecondscreen();
 723   3                    b=4;}
 724   2              
 725   2      
 726   2              if(enter==0 && b==4 && s<6 && s>1)
 727   2                 { WaitNms(250);
 728   3                  firstscreen();
 729   3                         b=4;}
 730   2      //      if(enter==0 && b==2 && s==5)//开始温度测量
 731   2               //  { WaitNms(250);
 732   2               //  LCDInit();
 733   2                    //  } 
 734   2              }
C51 COMPILER V7.06   TEXT1                                                                 11/05/2007 16:26:34 PAGE 13  

 735   1      
 736   1      }
*** WARNING C280 IN LINE 623 OF TEXT1.C: 'cha': unreferenced local variable
 737          
 738          
 739               
 740                    
 741                   //P1=0;
 742              /* if(start==0)
 743                 {
 744                  loop2:     secondscreen();
 745                  if(run==0)
 746                            {
 747                                  loop3: thirdscreen();
 748                          if(display==0)
 749                              {
 750                                       loop4:     fourthscreen();
 751                                WaitNms(250);             //等待时间
 752                                WaitNms(250);             //等待时间
 753                                                    WaitNms(250);         //等待时间
 754                                                    WaitNms(250);         //等待时间
 755                                                    WaitNms(250);         //等待时间
 756          
 757                                        fifthscreen();
 758                                                    WaitNms(250);         //等待时间
 759                                WaitNms(250);             //等待时间
 760                                                    WaitNms(250);         //等待时间
 761                                                    WaitNms(250);         //等待时间
 762                                                    WaitNms(250);         //等待时间
 763                                            if(close==0)
 764                                                  {

⌨️ 快捷键说明

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