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

📄 retime.lst

📁 单片机设计--关于2008奥运会的代码及仿真
💻 LST
📖 第 1 页 / 共 4 页
字号:
 483   5                               display();
 484   5                               kbscan();
 485   5                           if(!third_sure)i=51;   //如果不满足立即跳出
 486   5                              }
 487   4                      }
 488   3               }
C51 COMPILER V8.02   RETIME                                                                06/24/2007 13:22:44 PAGE 9   

 489   2          }
 490   1      }
 491          /*******************************
 492          月位闪烁子程序
 493          *******************************/
 494          void month_flash(void)
 495          {
 496   1          unsigned char i;
 497   1          if(TR0==0)                                  //为日位润平年二月天数做准备
 498   1          {
 499   2                  day_numo=judgement_leap();
 500   2                  day_numoo=day_numo;
 501   2          }
 502   1          if(fourth_sure)
 503   1          {
 504   2              month_unitstore=month_unit;
 505   2              month_decastore=month_decade;
 506   2              while(fourth_sure)
 507   2              {
 508   3                  for(i=0;i<18;i++)
 509   3                      {
 510   4                       month_unit=10;
 511   4                       month_decade=10;
 512   4                       year_thousand=year_thoustore;    //送原始数据避免取到不显示数据
 513   4                       year_hundred=year_hundstore;
 514   4                       year_decade=year_decastore;
 515   4                       year_unit=year_unitstore;
 516   4                       display();
 517   4                       kbscan();
 518   4                       if(!fourth_sure)i=51;
 519   4                      }
 520   3                  if(fourth_sure)
 521   3                      {
 522   4                       for(i=0;i<18;i++)
 523   4                               {      
 524   5                          month_unit=month_unitstore;
 525   5                          month_decade=month_decastore;//送原始数据避免取到不显示数据
 526   5                          year_thousand=year_thoustore;
 527   5                          year_hundred=year_hundstore;
 528   5                          year_decade=year_decastore;
 529   5                          year_unit=year_unitstore;
 530   5                              display();
 531   5                              kbscan();
 532   5                          if(!fourth_sure)i=51;
 533   5                              }
 534   4                      }
 535   3              }
 536   2      
 537   2          }
 538   1      }
 539          /*******************************
 540          日位闪烁子程序
 541          ******************************/
 542          void day_flash(void)
 543          {
 544   1          unsigned char i;
 545   1          if(fifth_sure)
 546   1          {
 547   2              day_unitstore=day_unit;
 548   2              day_decastore=day_decade;
 549   2              while(fifth_sure)
 550   2              {
C51 COMPILER V8.02   RETIME                                                                06/24/2007 13:22:44 PAGE 10  

 551   3                  for(i=0;i<18;i++)
 552   3                      {
 553   4                      day_unit=10;
 554   4                      day_decade=10;
 555   4                      month_unit=month_unitstore;       //送原始数据避免取到不显示数据
 556   4                      month_decade=month_decastore;
 557   4                      year_thousand=year_thoustore;
 558   4                      year_hundred=year_hundstore;
 559   4                      year_decade=year_decastore;
 560   4                      year_unit=year_unitstore;
 561   4                      display();
 562   4                      kbscan();
 563   4                      if(!fifth_sure)i=51;
 564   4                      }
 565   3                  if(fifth_sure)
 566   3                      {
 567   4                      for(i=0;i<18;i++)
 568   4                              {
 569   5                           day_unit=day_unitstore;
 570   5                           day_decade=day_decastore;
 571   5                           month_unit=month_unitstore;     //送原始数据避免取到不显示数据
 572   5                           month_decade=month_decastore;
 573   5                           year_thousand=year_thoustore;
 574   5                           year_hundred=year_hundstore;
 575   5                           year_decade=year_decastore;
 576   5                           year_unit=year_unitstore;
 577   5                               display();
 578   5                               kbscan();
 579   5                           if(!fifth_sure)i=51;
 580   5                              }
 581   4                      }
 582   3              }
 583   2          }
 584   1      }
 585          /*******************************
 586          倒计时位闪烁子程序
 587          *******************************/
 588          void retime_flash(void)
 589          {
 590   1          unsigned char i;
 591   1          if(sixth_sure)
 592   1          {
 593   2              retime_ustore=retime_unit;
 594   2              retime_dstore=retime_decade;
 595   2              retime_hstore=retime_hundred;
 596   2              retime_tstore=retime_thousand;
 597   2              while(sixth_sure)
 598   2              {
 599   3                   for(i=0;i<18;i++)
 600   3                       {
 601   4                      retime_unit=10;
 602   4                      retime_decade=10;
 603   4                      retime_hundred=10;
 604   4                      retime_thousand=10;
 605   4                      day_unit=day_unitstore;
 606   4                      day_decade=day_decastore;
 607   4                      display();
 608   4                      kbscan();
 609   4                      if(!sixth_sure)i=51;
 610   4                       }
 611   3                   if(sixth_sure)
 612   3                       {
C51 COMPILER V8.02   RETIME                                                                06/24/2007 13:22:44 PAGE 11  

 613   4                      for(i=0;i<18;i++)
 614   4                              {
 615   5                         retime_unit=retime_ustore;
 616   5                         retime_decade=retime_dstore;
 617   5                         retime_hundred=retime_hstore;
 618   5                         retime_thousand=retime_tstore;
 619   5                         day_unit=day_unitstore;
 620   5                         day_decade=day_decastore;
 621   5                         display();
 622   5                         kbscan();
 623   5                         if(!sixth_sure)i=51;
 624   5                              }
 625   4                       }
 626   3              }
 627   2              if(seventh_sure)                 //第八次确认键按下,启动定时器,将各位的数据全部弹出,时钟正常显示
 628   2              {
 629   3                  seventh_sure=0;
 630   3                  fen_ge=fenzhong_ge;                                 
 631   3                  fen_shi=fenzhong_shi;
 632   3                  shi_ge=xiaoshi_ge;  
 633   3                  shi_shi=xiaoshi_shi;
 634   3                  year_unit=year_unitstore;
 635   3                  year_decade=year_decastore;
 636   3                  year_hundred=year_hundstore;
 637   3                  year_thousand=year_thoustore;
 638   3                  month_unit=month_unitstore;
 639   3                  month_decade=month_decastore;
 640   3                  day_unit=day_unitstore;
 641   3                  day_decade=day_decastore;
 642   3                  retime_unit=retime_ustore;
 643   3                  retime_decade=retime_dstore;
 644   3                  retime_hundred=retime_hstore;
 645   3                  retime_thousand=retime_tstore;
 646   3                  TR0=1;                                      
 647   3              }
 648   2          }
 649   1      }
 650          /*******************************
 651          小时位闪烁子程序
 652          *******************************/
 653          void hour_flash(void)
 654          {   
 655   1          unsigned char i;
 656   1          if(first_sure)
 657   1          {   
 658   2              TR0=0;                //关定时器,进入闪烁 
 659   2              xiaoshi_ge=shi_ge;    //保存时个位显示的数据
 660   2              xiaoshi_shi=shi_shi;  //保存时十位显示的数据
 661   2              while(first_sure)     //第一次确认键按下,在小时位闪烁
 662   2              {       
 663   3                  for(i=0;i<18;i++) //小时位不显示,其它位显示
 664   3                      {       
 665   4                      shi_ge=10;
 666   4                      shi_shi=10;
 667   4                      display();
 668   4                      kbscan();
 669   4                      if(!first_sure)i=51;
 670   4                      }
 671   3                  if(first_sure)
 672   3                      {
 673   4                      for(i=0;i<18;i++)//小时位和其它位都显示
 674   4                              {       
C51 COMPILER V8.02   RETIME                                                                06/24/2007 13:22:44 PAGE 12  

 675   5                          shi_ge=xiaoshi_ge;
 676   5                          shi_shi=xiaoshi_shi;
 677   5                              display();
 678   5                              kbscan();
 679   5                          if(!first_sure)i=51;
 680   5                              }
 681   4                      }  
 682   3              }
 683   2          }
 684   1      }
 685          /******************************
 686          分钟位闪烁子程序
 687          *******************************/
 688          void min_flash(void)    
 689          {   
 690   1          unsigned char i;
 691   1          if(second_sure)
 692   1          {   
 693   2                  fenzhong_ge=fen_ge;     //保存分个位显示的数据
 694   2                  fenzhong_shi=fen_shi;   //保存分十位显示的数据
 695   2                  while(second_sure)      //第二次确认键按下,在分钟位闪烁
 696   2                      {
 697   3                      for(i=0;i<18;i++)//分钟位不显示,其它位都显示
 698   3                              {
 699   4                              fen_ge=10;
 700   4                              fen_shi=10;
 701   4                          shi_ge=xiaoshi_ge;  //送小时个位的原始数据,避免调到小时个位不显示时的数据
 702   4                          shi_shi=xiaoshi_shi;//送小时十位的原始数据,避免调到小时十位不显示时的数据
 703   4                              display();
 704   4                              kbscan();
 705   4                          if(!second_sure)i=51;
 706   4                              }
 707   3                      if(second_sure)
 708   3                              {
 709   4                          for(i=0;i<18;i++)      //分钟位和其它位都显示
 710   4                                      {
 711   5                              fen_ge=fenzhong_ge;
 712   5                              fen_shi=fenzhong_shi;
 713   5                              shi_ge=xiaoshi_ge;  //送小时个位的原始数据,避免调到小时个位不显示时的数据
 714   5                              shi_shi=xiaoshi_shi;//送小时十位的原始数据,避免调到小时十位不显示时的数据
 715   5                                      display();
 716   5                                      kbscan();
 717   5                              if(!second_sure)i=51;
 718   5                                      }
 719   4                              }       
 720   3                      }
 721   2          }
 722   1      }
 723          /******************************
 724          年位组合子程序
 725          ********************************/
 726          void year_joint(void)
 727          {   

⌨️ 快捷键说明

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