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

📄 51

📁 51单片机大量源码
💻
📖 第 1 页 / 共 4 页
字号:
C51 COMPILER V8.18   DA1302                                                                12/15/2009 15:11:35 PAGE 9   

 489   2                        if((id==8)&&(a==1))                                            //id为7时秒闪烁
 490   2                      {
 491   3                           OutputInformation(7,1,0x20); //不显示
 492   3                               OutputInformation(8,1,0x20); //不显示
 493   3                               }
 494   2                              else
 495   2                               {OutputInformation(7,1,R1302(0x81)/16+0x30); //显示秒
 496   3                    OutputInformation(8,1,R1302(0x81)%16+0x30); 
 497   3                               }
 498   2        /*******************************Exit显示闪烁控制********************/
 499   2      
 500   2                        if((id==9)&&(a==1))               //id为8时exit闪烁
 501   2                               {OutputInformation(11,1,0x20);     //不显示
 502   3                        OutputInformation(12,1,0x20);     //不显示
 503   3                            OutputInformation(13,1,0x20);     //不显示
 504   3                                OutputInformation(14,1,0x20);     //不显示
 505   3                           }
 506   2                        else
 507   2                            DisplayListChar(11,1,exit);       //显示exit
 508   2                      }
 509   1      }
 510          /***************************************modelo为2时date闪烁***********************************************
             -/
 511          void model2()
 512          {
 513   1                if(id==0)
 514   1                 {OutputInformation(9,1,0x20);        //不显示
 515   2                  OutputInformation(4,1,0x20);        //不显示
 516   2                      OutputInformation(15,1,0x20);       //不显示
 517   2                      DisplayListChar(0,1,TIMER);             //显示time    
 518   2                  DisplayListChar(10,1,alarmclock);   //显示clock
 519   2                  if(a==1)
 520   2                       {OutputInformation(5,1,0x20);     //不显示
 521   3                    OutputInformation(6,1,0x20);     //不显示
 522   3                        OutputInformation(7,1,0x20);     //不显示
 523   3                        OutputInformation(8,1,0x20);     //不显示
 524   3                       }
 525   2                       
 526   2                 else
 527   2                   DisplayListChar(5,1,DATE);         //显示date
 528   2                 }
 529   1      /*****************************************************************************************************/
 530   1                                                              //id不为零时、进入日期调整
 531   1      /*****************************************************************************************************/
 532   1                else                                                          
 533   1                 { OutputInformation(0,1,0x20);                  //不显示
 534   2                       OutputInformation(11,1,0x20);                 //不显示
 535   2                   OutputInformation(3,1,0x2f);                  //显示固定字符 "/"
 536   2               OutputInformation(6,1,0x2f);                  //显示固定字符 "/"
 537   2               OutputInformation(9,1,0x2f);                  //显示固定字符 "/"  
 538   2         /****************************年显示闪烁控制********************/
 539   2                       if((id==1)&&(a==1))                                               //id为1时年闪烁
 540   2                    {
 541   3                         OutputInformation(1,1,0x20);                //不显示
 542   3                         OutputInformation(2,1,0x20);                //不显示
 543   3                        }
 544   2                       else
 545   2                        {OutputInformation(1,1,R1302(0x8d)/16+0x30); //显示年
 546   3                 OutputInformation(2,1,R1302(0x8d)%16+0x30); 
 547   3                        }
 548   2         /***************************月闪烁控制************************/
 549   2                       if((id==2)&&(a==1))                                               //id为2时月闪烁
C51 COMPILER V8.18   DA1302                                                                12/15/2009 15:11:35 PAGE 10  

 550   2                    {
 551   3                         OutputInformation(4,1,0x20);                //不显示
 552   3                         OutputInformation(5,1,0x20);                //不显示
 553   3                        }
 554   2                       else
 555   2                        {OutputInformation(4,1,R1302(0x89)/16+0x30); //显示月
 556   3                 OutputInformation(5,1,R1302(0x89)%16+0x30); 
 557   3                        }
 558   2        /***************************日闪烁控制************************/
 559   2                       if((id==3)&&(a==1))                                               //id为2日闪烁
 560   2                    {
 561   3                         OutputInformation(7,1,0x20);                //不显示
 562   3                         OutputInformation(8,1,0x20);                //不显示
 563   3                        }
 564   2                       else
 565   2                        {OutputInformation(7,1,R1302(0x87)/16+0x30); //显示日
 566   3                 OutputInformation(8,1,R1302(0x87)%16+0x30); 
 567   3                        }
 568   2        /***************************星期闪烁控制*********************************/
 569   2                       if((id==4)&&(a==1))                                               //id为2时星期闪烁
 570   2                    {
 571   3                         OutputInformation(10,1,0x20);                //不显示
 572   3                        }
 573   2                       else
 574   2                        {OutputInformation(10,1,R1302(0x8b)%16+0x30); //显示星期
 575   3                        }
 576   2        /**************************exit闪烁控制*********************************/
 577   2                       if((id==5)&&(a==1))                                                //id为5时exit闪烁
 578   2                     { OutputInformation(12,1,0x20);     //不显示
 579   3                       OutputInformation(13,1,0x20);     //不显示
 580   3                           OutputInformation(14,1,0x20);     //不显示
 581   3                               OutputInformation(15,1,0x20);     //不显示
 582   3                           }
 583   2                       else
 584   2                         DisplayListChar(12,1,exit);                  //显示exit
 585   2                 }
 586   1      }
 587          /*********************************************************************************/
 588          
 589                                                                          /*model为3时进入闹铃项目
 590          
 591          /**********************************************************************************/
 592          void model3()
 593          {
 594   1            if(id==0) 
 595   1                 {OutputInformation(9,1,0x20);        //不显示
 596   2                  OutputInformation(4,1,0x20);        //不显示
 597   2                      OutputInformation(15,1,0x20);       //不显示
 598   2              DisplayListChar(0,1,TIMER);             //显示time 
 599   2                  DisplayListChar(5,1,DATE);          //显示date    
 600   2                  if(a==1)
 601   2                       { OutputInformation(10,1,0x20);     //不显示
 602   3                     OutputInformation(11,1,0x20);     //不显示
 603   3                         OutputInformation(12,1,0x20);     //不显示
 604   3                         OutputInformation(13,1,0x20);     //不显示
 605   3                         OutputInformation(14,1,0x20);
 606   3                       }
 607   2                  else
 608   2                   DisplayListChar(10,1,alarmclock);  //显示cloak
 609   2                 }
 610   1      
 611   1      /**************************id不为零进入闹铃设置显示********************/
C51 COMPILER V8.18   DA1302                                                                12/15/2009 15:11:35 PAGE 11  

 612   1               else
 613   1               {if(id==12)                                               //闹铃开关显示
 614   2                 {DisplayListChar(0,1,ClockSet);         //显示ClockSet
 615   3                      OutputInformation(8,1,0x20);
 616   3                      OutputInformation(13,1,0x20);
 617   3                      OutputInformation(14,1,0x20);
 618   3      /*****************************闹铃开关显示********************************/ 
 619   3                  if(a==1)                                                       //A为闪烁标志
 620   3                    {OutputInformation(10,1,0x20);     //不显示
 621   4                     OutputInformation(11,1,0x20);     //不显示
 622   4                         OutputInformation(12,1,0x20);     //不显示
 623   4                         OutputInformation(13,1,0x20);     //不显示
 624   4                        }     
 625   3                  else
 626   3                   {
 627   4                    if(R1302(0xc3)%16==0)            //闹铃寄存器的值是否为零(关)
 628   4                              {DisplayListChar(10,1,ClockOff);}//显示OFF
 629   4                        else
 630   4                          {OutputInformation(9,1,0x20);    //不显示
 631   5                               OutputInformation(12,1,0x20);   //不显示
 632   5                       OutputInformation(13,1,0x20);   //不显示
 633   5                           OutputInformation(14,1,0x20);   //不显示
 634   5                               OutputInformation(15,1,0x20);   //不显示
 635   5                               DisplayListChar(10,1,ClockOn);  //显示ON 
 636   5                              }
 637   4                       }
 638   3                 }
 639   2               else 
 640   2                 {DisplayListChar(0,1,alarmclock);   //显示clock
 641   3                  OutputInformation(8,1,0x3a);       //显示固定字符 ":"
 642   3                      OutputInformation(5,1,0x20);       //不显示
 643   3                      OutputInformation(11,1,0x20);      //不显示
 644   3      /**************************闹铃时闪烁显示**********************/                 
 645   3                  if((id==13)&&(a==1))                           //闹铃时闪烁
 646   3                        {
 647   4                         OutputInformation(6,1,0x20);
 648   4                         OutputInformation(7,1,0x20);
 649   4                        }
 650   3                      else
 651   3                        {OutputInformation(6,1,R1302(0xc5)/16+0x30); //显示闹铃时
 652   4                         OutputInformation(7,1,R1302(0xc5)%16+0x30); //显示闹铃时
 653   4                        }
 654   3      
 655   3      /**************************闹铃分闪烁显示*******************/
 656   3                      if((id==14)&&(a==1))               //闹铃分闪烁
 657   3                       {OutputInformation(9,1,0x20);     //不显示
 658   4                        OutputInformation(10,1,0x20);    //不显示
 659   4                        
 660   4                       }
 661   3                      else
 662   3                        {OutputInformation(9,1,R1302(0xc7)/16+0x30);  //显示闹铃分
 663   4                         OutputInformation(10,1,R1302(0xc7)%16+0x30); //显示闹铃分
 664   4                        }
 665   3      
 666   3      /************************exit闪烁显示***********************/
 667   3                      if((id==15)&&(a==1))                       //exie闪烁
 668   3                        {OutputInformation(12,1,0x20);   //不显示
 669   4                     OutputInformation(13,1,0x20);   //不显示
 670   4                         OutputInformation(14,1,0x20);   //不显示
 671   4                         OutputInformation(15,1,0x20);   //不显示
 672   4                        }
 673   3                      else
C51 COMPILER V8.18   DA1302                                                                12/15/2009 15:11:35 PAGE 12  

 674   3                        DisplayListChar(12,1,exit);      //显示exit                                                              
 675   3                 }
 676   2               }
 677   1      }
 678                                                                  
 679          /*********************************背光灯设置*****************************************/
 680          void model4()
 681          {
 682   1                if(id==0)                                                             //id为零未进入背光灯设置
 683   1                 {OutputInformation(10,1,0x20);       //不显示
 684   2                  OutputInformation(11,1,0x20);       //不显示
 685   2                  OutputInformation(4,1,0x20);        //不显示
 686   2                      DisplayListChar(5,1,reset);         //显示reset         
 687   2                      DisplayListChar(12,1,exit);         //显示exit
 688   2                      if(a==1)
 689   2                        {OutputInformation(0,1,0x20);     //不显示
 690   3                     OutputInformation(1,1,0x20);     //不显示
 691   3                         OutputInformation(2,1,0x20);     //不显示
 692   3                         OutputInformation(3,1,0x20);     //不显示
 693   3                         }
 694   2                      else
 695   2                DisplayListChar(0,1,lamp);        //显示lamp
 696   2                  }
 697   1               else                                                       //id不为零(10)进入背光灯时间设置
 698   1                 {DisplayListChar(0,1,lamp);          //显示lamp
 699   2                      DisplayListChar(4,1,set);           //显示set
 700   2                      DisplayListChar(9,1,sec);           //显示sec
 701   2                      DisplayListChar(12,1,exit);         //显示exit
 702   2                      if((id==10)&&(a==1))
 703   2                         {
 704   3                              OutputInformation(7,1,0x20);      //不显示               
 705   3                  OutputInformation(8,1,0x20);}
 706   2                      else
 707   2                        {
 708   3                         OutputInformation(7,1,R1302(0xc1)/16+0x30); //读出背光灯延时时间
 709   3                         OutputInformation(8,1,R1302(0xc1)%16+0x30);
 710   3                        }
 711   2                      if((id==11)&&(a==1))
 712   2                        {OutputInformation(12,1,0x20);     //不显示
 713   3                     OutputInformation(13,1,0x20);     //不显示
 714   3                         OutputInformation(14,1,0x20);     //不显示
 715   3                         OutputInformation(15,1,0x20);     //不显示
 716   3                        }
 717   2               }
 718   1      
 719   1      }
 720          /*********************************时间归零设置*****************************************/
 721          void model5()
 722          {       
 723   1              OutputInformation(4,1,0x20);        //不显示
 724   1                  OutputInformation(10,1,0x20);       //不显示
 725   1                      OutputInformation(11,1,0x20);       //不显示
 726   1                  DisplayListChar(0,1,lamp);          //显示lamp
 727   1                  DisplayListChar(12,1,exit);         //显示exit
 728   1                      if(a==1)
 729   1                       { OutputInformation(5,1,0x20);     //不显示
 730   2                     OutputInformation(6,1,0x20);     //不显示
 731   2                         OutputInformation(7,1,0x20);     //不显示
 732   2                         OutputInformation(8,1,0x20);     //不显示
 733   2                         OutputInformation(9,1,0x20);
 734   2                       }
 735   1                      else

⌨️ 快捷键说明

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