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

📄 显示子程序.lst

📁 编写的lcd c程序
💻 LST
📖 第 1 页 / 共 3 页
字号:
 330   5                                                              second++;
 331   5                                                              if(second== 60)
C51 COMPILER V8.16   显示子程序                                                            11/26/2000 18:33:26 PAGE 7   

 332   5                                                              second = 0;
 333   5                                                      }       
 334   4                                              }
 335   3                                        }
 336   2                                    break;
 337   2                      case(2): {
 338   3                                              Lcd_writenum1ber(0x1c,0x05,minuteh);
 339   3                                              Lcd_writenum1ber(0x1c,0x06,minutel);
 340   3                                              if(K2 == 0)
 341   3                                              {
 342   4                                                      delay();
 343   4                                                      if(K2 == 0)
 344   4                                                      {
 345   5                                                              while(K2 == 0) ;
 346   5                                                              minute ++;
 347   5                                                              if(minute == 60)
 348   5                                                              minute = 0;
 349   5                                                      }
 350   4                                              }
 351   3                                        }
 352   2                                    break;
 353   2                      case(3): {
 354   3                                              Lcd_writenum1ber(0x1c,0x02,hourh);
 355   3                                              Lcd_writenum1ber(0x1c,0x03,hourl);
 356   3                                              if(K2 == 0)
 357   3                                              {
 358   4                                                      delay();
 359   4                                                      if(K2 == 0)
 360   4                                                      {
 361   5                                                              while(K2 == 0) ;
 362   5                                                              hour ++;
 363   5                                                              if(hour == 24)
 364   5                                                              hour = 0;
 365   5                                                      }
 366   4                                              }
 367   3                                              
 368   3                                        }
 369   2                                    break;
 370   2                      case(4): {
 371   3                                              Lcd_writenum1ber(0x09,0x0c,dayh);
 372   3                                              Lcd_writenum1ber(0x09,0x0d,dayl);
 373   3                                              if(K2 == 0)
 374   3                                              {
 375   4                                                      delay();
 376   4                                                      if(K2 == 0)
 377   4                                                      {
 378   5                                                              while(K2 == 0) ;
 379   5                                                              day ++;
 380   5                                                              if(day == 32)
 381   5                                                              day = 0;
 382   5                                                      }
 383   4                                              }
 384   3                                        }
 385   2                                    break;
 386   2                  case(5): {
 387   3                                              Lcd_writenum1ber(0x09,0x08,monthh);
 388   3                                              Lcd_writenum1ber(0x09,0x09,monthl);
 389   3                                              if(K2 == 0)
 390   3                                              {
 391   4                                                      delay();
 392   4                                                      if(K2 == 0)
 393   4                                                      {
C51 COMPILER V8.16   显示子程序                                                            11/26/2000 18:33:26 PAGE 8   

 394   5                                                              while(K2 == 0) ;
 395   5                                                              month ++;
 396   5                                                              if(month == 13)
 397   5                                                              month = 0;
 398   5                                                      }
 399   4                                              }
 400   3                                      
 401   3                                        }
 402   2                                    break;
 403   2                      case(6): {
 404   3                                              Lcd_writenum1ber(0x09,0x04,yearh);
 405   3                                              Lcd_writenum1ber(0x09,0x05,yearl);
 406   3                                              if(K2 == 0)
 407   3                                              {
 408   4                                                      delay();
 409   4                                                      if(K2 == 0)
 410   4                                                      {
 411   5                                                              while(K2 == 0) ;
 412   5                                                              year ++;
 413   5                                                              if(year == 100)
 414   5                                                              year = 0;
 415   5                                                      }
 416   4                                              }
 417   3                                      
 418   3                                        }
 419   2                                    break;
 420   2                      default: break;
 421   2      
 422   2                      }
 423   1              }
 424          
 425          void dealdata()
 426          {
 427   1              yearh = year/10;
 428   1              yearl = year%10;
 429   1              monthh = month/10;
 430   1              monthl = month%10;
 431   1              dayh = day/10;
 432   1              dayl = day%10;
 433   1              hourh = hour/10;
 434   1              hourl = hour%10;
 435   1              minuteh = minute/10;
 436   1              minutel = minute%10;
 437   1              secondh = second/10;
 438   1              secondl = second%10;
 439   1      }
 440          
 441          
 442          main()
 443          {
 444   1              Lcd_int();
 445   1              Lcd_cls();
 446   1              while(1)
 447   1              {
 448   2                      Lcd_setside();
 449   2                      dealdata();
 450   2                  Lcd_writenumber(0x09,0x02,0x02);
 451   2                      Lcd_writenumber(0x09,0x03,0x00);
 452   2                      Lcd_writenumber(0x09,0x04,yearh);
 453   2                      Lcd_writenumber(0x09,0x05,yearl);
 454   2                      Lcd_writechina(0x09,0x06,0x00);
 455   2                      Lcd_writenumber(0x09,0x08,monthh);
C51 COMPILER V8.16   显示子程序                                                            11/26/2000 18:33:26 PAGE 9   

 456   2                      Lcd_writenumber(0x09,0x09,monthl);
 457   2                      Lcd_writechina(0x09,0x0a,0x01);
 458   2                      Lcd_writenumber(0x09,0x0c,dayh);
 459   2                      Lcd_writenumber(0x09,0x0d,dayl);
 460   2                      Lcd_writechina(0x09,0x0e,0x02);
 461   2                  Lcd_writenumber(0x1c,0x02,hourh);
 462   2                      Lcd_writenumber(0x1c,0x03,hourl);
 463   2                      Lcd_writenumber(0x1c,0x04,0x0a);
 464   2                      Lcd_writenumber(0x1c,0x05,minuteh);
 465   2                      Lcd_writenumber(0x1c,0x06,minutel);
 466   2                      Lcd_writenumber(0x1c,0x07,0x0a);
 467   2                      Lcd_writenumber(0x1c,0x08,secondh);
 468   2                      Lcd_writenumber(0x1c,0x09,secondl);
 469   2                      Lcd_writechina(0x1c,0x0b,0x03);
 470   2                      Lcd_writechina(0x1c,0x0d,0x04);
 471   2                      Lcd_writechina(0x1c,0x0f,0x05);
 472   2                      Lcd_writechina(0x2e,0x0c,0x0d);
 473   2                      Lcd_writechina(0x2e,0x0e,0x0e);
 474   2                      Lcd_writechina(0x2e,0x10,0x0f);
 475   2                      Lcd_writechina(0x2e,0x12,0x10);
 476   2                      Lcd_writechina(0x2e,0x14,0x11);
 477   2                      Lcd_writechina(0x2e,0x16,0x12);
 478   2                      Lcd_writechina(0x2e,0x18,0x13);
 479   2                      Lcd_writechina(0x2e,0x1a,0x14);
 480   2                  dealkey1();
 481   2                      choicedata();       
 482   2              }
 483   1      }
 484          
 485          
 486          
 487          
 488          
 489          
 490          
 491          
 492          
 493          
 494          
 495          
 496          
 497          
 498          
 499          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1726    ----
   CONSTANT SIZE    =   1024    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     23      36
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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