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

📄 test.lst

📁 液晶程序,用汇编语言编写,用于单片机开发中
💻 LST
📖 第 1 页 / 共 2 页
字号:
 248   3                                         break;
 249   3                case OK_Down:
 250   3                           Ok_Down_function();
 251   3                            
 252   3                                         break;
 253   3            default: 
 254   3      
 255   3                             break;
 256   3      
 257   3                 }
 258   2           }; 
 259   1        // switch(Current_screen_num)
 260   1        
 261   1      }
 262          /*------键盘响应函数----------*/
 263          
 264          
 265          
 266          void Down_Down_function()
 267          {
 268   1          switch(Current_screen_num)
 269   1              {
 270   2                case Main_menu:
 271   2                      if(Currrent_Position==1)
 272   2                                {
 273   3                                wr_lcd (comm,0x84);
 274   3                                Currrent_Position=2;   //
 275   3                                //voice_function();
 276   3                                return;
 277   3                                }
 278   2                                
 279   2                              if(Currrent_Position==2)
 280   2                                {
 281   3                                wr_lcd (comm,0x87);
 282   3                                Currrent_Position=3;
 283   3                                return;
 284   3                                }
 285   2                                if(Currrent_Position==3)
 286   2                                {
 287   3                                voice_function();
 288   3                                return;
 289   3                                }                       
 290   2                case Wave_Choose_menu:
 291   2                     if(Currrent_Position==1)
 292   2                                {
 293   3                                wr_lcd (comm,0x87);
 294   3                                Currrent_Position=2;   //
 295   3                                //voice_function();
 296   3                                return;
 297   3                                }
 298   2                                
 299   2                              if(Currrent_Position==2)
 300   2                                {
 301   3                                wr_lcd (comm,0x91);
 302   3                                Currrent_Position=3;
 303   3                                return;
C51 COMPILER V8.02   TEST                                                                  01/27/2007 22:14:50 PAGE 6   

 304   3                                }
 305   2                              if(Currrent_Position==3)
 306   2                               { 
 307   3                                wr_lcd (comm,0x89);
 308   3                                Currrent_Position=4;
 309   3                                return;
 310   3                                }
 311   2                                if(Currrent_Position==4)
 312   2                                {
 313   3                                voice_function();
 314   3                                return;
 315   3                                }                            
 316   2                
 317   2                
 318   2                default:
 319   2                   break;
 320   2      
 321   2      
 322   2              }
 323   1        
 324   1      }
 325          
 326          
 327          void Up_Down_function()
 328          {
 329   1       switch(Current_screen_num)
 330   1              {
 331   2                case Main_menu:
 332   2                      if(Currrent_Position==1)        //在主菜单下位置1说明是要进入波形选择菜单
 333   2                                {
 334   3                                //wr_lcd (comm,0x84);
 335   3                                //Currrent_Position=2;         //
 336   3                                voice_function();//不可能再上去了故叫一声
 337   3                                return;
 338   3                                }
 339   2                                
 340   2                              if(Currrent_Position==2)
 341   2                                {
 342   3                                wr_lcd (comm,0x81);
 343   3                                Currrent_Position=1;
 344   3                                return;
 345   3                                }
 346   2                               if(Currrent_Position==3)
 347   2                                {
 348   3                                wr_lcd (comm,0x84);
 349   3                                Currrent_Position=2;
 350   3                                return;
 351   3                                }
 352   2                case Wave_Choose_menu:
 353   2                       if(Currrent_Position==1)       //在波形选择单下位置1说明是要进入波形选择菜单
 354   2                                 {
 355   3                                //wr_lcd (comm,0x84);
 356   3                                //Currrent_Position=2;         //
 357   3                                 voice_function();//不可能再上去了故叫一声
 358   3                                 return;
 359   3                                  }
 360   2                                
 361   2                                if(Currrent_Position==2)
 362   2                                 {
 363   3                                  wr_lcd (comm,0x82);
 364   3                                  Currrent_Position=1;
 365   3                                  return;
C51 COMPILER V8.02   TEST                                                                  01/27/2007 22:14:50 PAGE 7   

 366   3                                 }
 367   2                               if(Currrent_Position==3)
 368   2                                {
 369   3                                wr_lcd (comm,0x87);
 370   3                                Currrent_Position=2;
 371   3                                return;
 372   3                                }
 373   2                               if(Currrent_Position==4)
 374   2                                {
 375   3                                wr_lcd (comm,0x91);
 376   3                                Currrent_Position=3;
 377   3                                return;
 378   3                                }
 379   2      
 380   2                        
 381   2      
 382   2                                                        
 383   2                      
 384   2                default:
 385   2                   break;
 386   2      
 387   2      
 388   2              }
 389   1      
 390   1      }
 391          
 392          
 393          void Ok_Down_function()
 394          {
 395   1       switch(Current_screen_num)
 396   1              {
 397   2                case Main_menu:
 398   2                      if(Currrent_Position==1)
 399   2                                {
 400   3                                display_all_screen(Wave_Choose_menu);
 401   3                                Current_screen_num=Wave_Choose_menu;
 402   3                                Currrent_Position=1;
 403   3                                wr_lcd (comm,0x0D);  /*开显示,不关游标*/
 404   3                                wr_lcd (comm,0x82);
 405   3      
 406   3                                return;
 407   3                                }
 408   2                                if(Currrent_Position==2)
 409   2                                {
 410   3                                display_all_screen(Fruequency_Choose_menu);
 411   3                                Current_screen_num=Fruequency_Choose_menu;
 412   3                                Currrent_Position=1;
 413   3                                wr_lcd (comm,0x0D);  /*开显示,不关游标*/
 414   3                                wr_lcd (comm,0x86);
 415   3                                return;
 416   3                                }
 417   2                                if(Currrent_Position==3)
 418   2                                {
 419   3                                display_all_screen(Wave_range);
 420   3                                Current_screen_num=Wave_range;
 421   3                                Currrent_Position=1;
 422   3                                wr_lcd (comm,0x0D);  /*开显示,不关游标*/
 423   3                                wr_lcd (comm,0x86);
 424   3                                return;
 425   3                                }
 426   2                      case Wave_Choose_menu:
 427   2                            Shown_Main_menu();       //现在这些地方不写东西到以后再写进去
C51 COMPILER V8.02   TEST                                                                  01/27/2007 22:14:50 PAGE 8   

 428   2                                break;
 429   2                      case Fruequency_Choose_menu:
 430   2                           Shown_Main_menu();
 431   2                                break;
 432   2                  case Wave_range:
 433   2                           Shown_Main_menu();
 434   2                                break;
 435   2                          
 436   2      
 437   2                              
 438   2                               
 439   2      
 440   2                                                        
 441   2                      
 442   2                default:
 443   2                   break;
 444   2      
 445   2      
 446   2              }
 447   1      
 448   1      
 449   1      }
 450          
 451          void Shown_Main_menu()
 452             {
 453   1         display_all_screen(Main_menu);
 454   1        wr_lcd (comm,0x0D);  /*开显示,不关游标*/
 455   1        wr_lcd (comm,0x81);
 456   1        Currrent_Position=1;
 457   1        Current_screen_num=Main_menu;
 458   1         }
 459          
 460          
 461          main()
 462          {  
 463   1         
 464   1         inicial_timer ();
 465   1      
 466   1      
 467   1        wr_lcd (comm,0x30);  /*30---基本指令动作*/
 468   1        wr_lcd (comm,0x01);  /*清屏,地址指针指向00H*/
 469   1        wr_lcd (comm,0x06);  /*光标的移动方向*/
 470   1        wr_lcd (comm,0x0D);  /*开显示,不关游标*/
 471   1        wr_lcd (comm,0x80);  //这是置AC为0;
 472   1      
 473   1      
 474   1      for(Current_screen_num=0;Current_screen_num<5;Current_screen_num++)
 475   1       {
 476   2         display_all_screen(Current_screen_num);
 477   2         delay_ms(1000);
 478   2        }
 479   1         //voice_function();
 480   1        Shown_Main_menu();
 481   1      
 482   1        while(1)
 483   1        {
 484   2        respond_key_down();
 485   2        }
 486   1      
 487   1      }


C51 COMPILER V8.02   TEST                                                                  01/27/2007 22:14:50 PAGE 9   

MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    724    ----
   CONSTANT SIZE    =    512    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      3       5
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      1    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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