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

📄 12232.lst

📁 12232液晶显示程序在,对写液晶的人来说
💻 LST
📖 第 1 页 / 共 2 页
字号:
 257   1      {
 258   2      SetPage(page,page);
 259   2      SetAddress(0,0);
 260   2      for (i=0;i<61;i++){PutCharR(0);PutCharL(0);}
 261   2      }
 262   1      } 
 263          
 264          //-----------------------------------------------------------
 265          //图片显示
 266          //采用字模2生成或字模3生成的都可以.
 267          //-----------------------------------------------------------
 268          void DrawBmp1(uint x_add, uchar width,uchar *bmp)
 269          {
 270   1      uchar x,address,i=0;     //address表示显存的物理地址
 271   1      uchar page=0;   //page表示上下两页
 272   1      bit window=0;  //window表示左右两页
 273   1      //putcharR      //右边
 274   1      //putcharL      //左边
 275   1      for (x=width;x>1;x--)
 276   1      {
 277   2      if (x_add>60) {window=1;address=x_add%61;}
 278   2      else address=x_add;     
 279   2      
 280   2      
 281   2              SetPage(0,0);
 282   2              SetAddress(address,address);
 283   2              if(window==1)PutCharR(bmp[i]);
 284   2              else    PutCharL(bmp[i]);
 285   2              SetPage(1,1);
 286   2              SetAddress(address,address);
 287   2              if(window==1)PutCharR(bmp[i+width]);
 288   2              else    PutCharL(bmp[i+width]);
 289   2              
 290   2              
 291   2              SetPage(2,2);
 292   2              SetAddress(address,address);
 293   2              if(window==1)PutCharR(bmp[i+width+width]);
 294   2              else    PutCharL(bmp[i+width+width]);
 295   2              SetPage(3,3);
 296   2              SetAddress(address,address);
 297   2              if(window==1)PutCharR(bmp[i+width+width+width]);
 298   2              else    PutCharL(bmp[i+width+width+width]);     
 299   2          i++;
 300   2          x_add++;
 301   2         
 302   2      }
 303   1      }
C51 COMPILER V7.09   12232                                                                 03/11/2004 16:59:54 PAGE 6   

 304          
 305          //---------------------------------------------------------------
 306          //---------------------------------------------------------------
 307          //采用zimo2  显示汉字,以汉字的显示方式
 308          //void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
 309          //d_where表示在码表中第几个汉字,x_add横坐标位置,layer显示的层, width显示的宽度。
 310          //---------------------------------------------------------------
 311          
 312          
 313          void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
 314          {
 315   1      uchar x,i=0,address;     //address表示显存的物理地址
 316   1      uchar page=0;   //page表示上下两页
 317   1      bit window=0;  //window表示左右两页
 318   1      //putcharR      //右边
 319   1      //putcharL      //左边
 320   1      d_where=d_where*32;
 321   1      
 322   1      for (x=width;x>1;x--)
 323   1      {
 324   2      if (x_add>60) {window=1;address=x_add%61;}
 325   2      else address=x_add;     
 326   2      
 327   2      if(layer==0)    //显示一行八个字
 328   2              {
 329   3              
 330   3              SetPage(0,0);
 331   3              SetAddress(address,address);
 332   3              if(window==1)PutCharR(bmp001[d_where]);//右边
 333   3              else    PutCharL(bmp001[d_where]);//左边
 334   3              SetPage(1,1);
 335   3              SetAddress(address,address);
 336   3              if(window==1)PutCharR(bmp001[d_where+width]);
 337   3              else    PutCharL(bmp001[d_where+width]);
 338   3      
 339   3              }
 340   2      else
 341   2              {       //显示第二行八个汉字
 342   3              SetPage(2,2);
 343   3              SetAddress(address,address);
 344   3              if(window==1)PutCharR(bmp001[d_where]);//右边
 345   3              else    PutCharL(bmp001[d_where]);//左边
 346   3              SetPage(3,3);
 347   3              SetAddress(address,address);
 348   3              if(window==1)PutCharR(bmp001[d_where+width]);
 349   3              else    PutCharL(bmp001[d_where+width]);
 350   3      
 351   3              }
 352   2          x_add++;
 353   2         d_where++;
 354   2      }
 355   1      }
 356          /*
 357          //------------------------------------------------------------------
 358          //字模2显示一个汉字
 359          //纵向取模,字节倒序
 360          void    disp_one(bit top_low,bit widows,uchar address,uchar width,uchar*bmp)
 361          {       
 362          if(top_low==0)
 363                  {
 364                  SetPage(0,0);
 365                  SetAddress(address,address);
C51 COMPILER V7.09   12232                                                                 03/11/2004 16:59:54 PAGE 7   

 366                  if(window==1)PutCharR(bmp001[next][i]);
 367                  else    PutCharL(bmp001[next][i]);
 368                  SetPage(1,1);
 369                  SetAddress(address,address);
 370                  if(window==1)PutCharR(bmp001[next][i+width]);
 371                  else    PutCharL(bmp001[next][i+width]);
 372                  }
 373          else
 374                  {
 375                  SetPage(0,0);
 376                  SetAddress(address,address);
 377                  if(window==1)PutCharR(bmp001[next][i]);
 378                  else    PutCharL(bmp001[next][i]);
 379                  SetPage(1,1);
 380                  SetAddress(address,address);
 381                  if(window==1)PutCharR(bmp001[next][i+width]);
 382                  else    PutCharL(bmp001[next][i+width]);
 383                  }
 384          }
 385          */
 386          
 387          
 388          
 389          
 390          //液晶显示规则
 391          //      M(左)           S(右)
 392          //      page            page
 393          //      0       |       0
 394          //      1       |       1
 395          //      2       |       2
 396          //      3       |       3
 397          
 398          void    delay1s(unsigned char i)
 399          {
 400   1              while(i>1)
 401   1              {
 402   2                      i--;
 403   2              
 404   2                      delay(65530);
 405   2              }
 406   1      }
 407          
 408          //显示动态的等待图标
 409          void    wait1(unsigned char i)
 410          {
 411   1              for(;i>1;i--)
 412   1              {delay1s(2);
 413   2              clrscr(); //
 414   2              DrawBmp1(0,60,Bmptc); //
 415   2              DrawBmp1(76,19,Bmpt1); //
 416   2              delay1s(2);
 417   2              clrscr(); //
 418   2              DrawBmp1(0,60,Bmptc); //
 419   2              DrawBmp1(76,19,Bmpt2); //
 420   2              delay1s(2);
 421   2              clrscr(); //
 422   2              DrawBmp1(0,60,Bmptc); //
 423   2              DrawBmp1(76,19,Bmpt3); //
 424   2              delay1s(2);
 425   2              clrscr(); //
 426   2              DrawBmp1(0,60,Bmptc); //
 427   2              DrawBmp1(76,19,Bmpt4); //
C51 COMPILER V7.09   12232                                                                 03/11/2004 16:59:54 PAGE 8   

 428   2              delay1s(2);
 429   2              clrscr(); //
 430   2              DrawBmp1(0,60,Bmptc); //
 431   2              DrawBmp1(76,19,Bmpt5); //
 432   2              delay1s(2);
 433   2              clrscr(); //
 434   2              DrawBmp1(0,60,Bmptc); //
 435   2              DrawBmp1(76,19,Bmpt6); //
 436   2              delay1s(2);
 437   2              clrscr(); //
 438   2              DrawBmp1(0,60,Bmptc); //
 439   2              DrawBmp1(76,19,Bmpt7); //
 440   2              }
 441   1      
 442   1      }
 443          
 444          
 445          //演示程序
 446          void main()                                                                                               
             -                           
 447          {                
 448   1                                                                                                           
 449   1       lcdini(); //reset                                                   
 450   1       clrscr(); //clr          
 451   1       
 452   1                                                    
 453   1       Draw_word(0,0,0,16); //
 454   1       Draw_word(1,16,0,16); //
 455   1       Draw_word(2,32,0,16); //
 456   1       Draw_word(3,48,0,16); //
 457   1       Draw_word(0,64,0,16); //
 458   1       Draw_word(1,80,0,16); //
 459   1       Draw_word(2,96,0,16); //
 460   1      
 461   1       DrawBmp(1,120,Bmp002); //
 462   1       clrscr(); //
 463   1       delay1s(3);
 464   1       DrawBmp1(0,122,Bmp012); //LOGO
 465   1       while(1)
 466   1              {
 467   2              delay1s(3);
 468   2      
 469   2              clrscr(); //
 470   2              DrawBmp1(10,101,Bmp07); //
 471   2              
 472   2              delay1s(8);
 473   2              clrscr(); //
 474   2              wait1(3);
 475   2              DrawBmp1(0,122,Bmp04); //
 476   2              delay1s(8);
 477   2              clrscr(); //
 478   2              wait1(3);
 479   2              DrawBmp1(0,122,Bmp03); //超前科技
 480   2              delay1s(8);
 481   2              clrscr(); //
 482   2              wait1(3);
 483   2              clrscr(); //
 484   2              DrawBmp1(10,101,Bmp05); //
 485   2              delay1s(8);
 486   2              clrscr(); //
 487   2              wait1(3);
 488   2              clrscr(); //
C51 COMPILER V7.09   12232                                                                 03/11/2004 16:59:54 PAGE 9   

 489   2              DrawBmp1(10,101,Bmp06); //
 490   2              delay1s(8);
 491   2              clrscr(); //
 492   2              wait1(3);
 493   2              clrscr(); //
 494   2              DrawBmp1(10,101,Bmp08); //
 495   2              delay1s(8);
 496   2              clrscr(); //
 497   2              wait1(3);
 498   2              clrscr(); //
 499   2              DrawBmp1(0,122,Bmp01); //这仿真器真不错,用过都说好.
 500   2              wait1(8);
 501   2              }                                                        
 502   1       }                
 503           
 504                                                   


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1418    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      26
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----       5
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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