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

📄 lcd_display.lst

📁 LCD多级菜单显示程序!320*240的LCD显示器!全部调试通过的!
💻 LST
📖 第 1 页 / 共 2 页
字号:
 184   2                              column = 0x80;
 185   2                              row = 0x88;
 186   2                              break;
 187   2                      case 3:
 188   2                              column = 0x90;
 189   2                              row = 0x88;
 190   2                              break;
 191   2              }
 192   1              for(j=0;j<=15;j++)
 193   1              {
 194   2                      for(i=0;i<=7;i++)
 195   2                      {
 196   3                              LcdCommand(0x34);
 197   3                              LcdCommand(column+j);                           //起始行
 198   3                              LcdCommand(row+i);                                      //起始列
 199   3                      //      LcdCommand(0x30);                                       //
 200   3                              LcdData(0xff);                                          //输入显示数据(横向高8位数据)
 201   3                              LcdData(0xff);                                          //输入显示数据(横向低8位数据)
 202   3                      }
 203   2              }
 204   1              LcdCommand(0x36);
 205   1              LcdCommand(0x30);
 206   1      }
 207          /***********************************
 208          大图表显示  通讯设置函数用
 209          y=0~3    ;  x=0~15
 210          ************************************/
 211          /*
 212          void Reverse(y,x1,x2)
 213          unsigned char y,x1,x2;
 214          {
 215                  unsigned char row,column,x,j;
 216                  ClearGraph();
 217                  for(x = x1; x <= x2; x++)
 218                  {
 219                          switch(y)
 220                          {
 221                                  case 0:
 222                                          column = 0x80;
 223                                          row = 0x80 + x/2;
 224                                          break;
 225                                  case 1:
 226                                          column = 0x90;
 227                                          row = 0x80 + x/2;
 228                                          break;
 229                                  case 2:
 230                                          column = 0x80;
 231                                          row = 0x88 + x/2;
 232                                          break;
 233                                  case 3:
 234                                          column = 0x90;
 235                                          row = 0x88 + x/2;
 236                                          break;
 237                          }
 238                          if (x%2)                                                                        //if the location is odd
 239                          {       
 240                                  for(j=0;j<=15;j++)
 241                                  {
C51 COMPILER V7.08   LCD_DISPLAY                                                           10/31/2007 10:13:27 PAGE 5   

 242                                          LcdCommand(0x34);
 243                                          LcdCommand(column+j);                           //起始行
 244                                          LcdCommand(row);                                        //起始列
 245                                  //      LcdCommand(0x30);                                       //
 246                                          //半字
 247                                          LcdData(0);                                                     //输入显示数据(横向高8位数据)
 248                                          LcdData(0xff);                                          //输入显示数据(横向低8位数据)
 249                                  }
 250                          }
 251                          else if(x<x2)
 252                          {       
 253                                  for(j=0;j<=15;j++)
 254                                  {
 255                                          LcdCommand(0x34);
 256                                          LcdCommand(column+j);                           //起始行
 257                                          LcdCommand(row);                                        //起始列
 258                                  //      LcdCommand(0x30);                                       //
 259                                          //半字
 260                                          LcdData(0xff);                                          //输入显示数据(横向高8位数据)
 261                                          LcdData(0xff);                                          //输入显示数据(横向低8位数据)
 262                                  }
 263                                  x++;
 264                          }
 265                          else
 266                          {       
 267                                  for(j=0;j<=15;j++)
 268                                  {
 269                                          LcdCommand(0x34);
 270                                          LcdCommand(column+j);                           //起始行
 271                                          LcdCommand(row);                                        //起始列
 272                                  //      LcdCommand(0x30);                                       //
 273                                          LcdData(0xff);                                          //输入显示数据(横向高8位数据)
 274                                          LcdData(0);                                             //输入显示数据(横向低8位数据)
 275                                  }
 276                          }
 277                          LcdCommand(0x36);
 278                          LcdCommand(0x30);
 279                  }
 280          }*/
 281          
 282          /***********************************
 283          图形显示程序步骤:
 284          1、写Y坐标
 285          2、写X坐标
 286          3、写D15-D8
 287          4、写D7-D0
 288          ***********************************/
 289          /*
 290          void pic_show(p)//y,x,
 291          unsigned char *p;//y,x,
 292          {
 293                  unsigned char i,j;
 294                  LcdCommand(0x36);  
 295                  for(i=0x80;i<0xa0;i++)                  //写上半屏
 296                  {
 297                          for(j=0x80;j<0x88;j++)
 298                          {
 299                                  LcdCommand(i);
 300                                  LcdCommand(j);
 301                                  LcdData(*p);
 302                                  LcdData(*(p+1));
 303                                  p = p + 2;
C51 COMPILER V7.08   LCD_DISPLAY                                                           10/31/2007 10:13:27 PAGE 6   

 304                          }
 305                  }
 306                  for(i=0x80;i<0xa0;i++)          //写下半屏
 307                  {
 308                          for(j=0x88;j<0x90;j++)
 309                          {
 310                                  LcdCommand(i);
 311                                  LcdCommand(j);
 312                                  LcdData(*p);
 313                                  LcdData(*(p+1));
 314                                  p = p + 2;
 315                          }
 316                  }
 317                  LcdCommand(0x36);
 318                  LcdCommand(0x30);
 319          } */
 320          /*
 321          void main()
 322          {                       struct TIME time;
 323                                  struct DATE date;       
 324                                  unsigned char temp[10];
 325                                  time.sec = 30;  
 326                                  time.min = 12;
 327                                  time.hour =15;
 328                                  
 329                                  date.day = 0x15;
 330                                  date.mon = 0x10;
 331                                  date.year =0x07;
 332                                  date.week =0x01;
 333                                  InitLcd();
 334                                  AUXR=0x01;      //在使用MOVX指令时访问外部RAM,如果AUXR = 0X01
 335                                                          //则在使用MOVX时访问片内自带RAM                 
 336                                  init5045();     
 337                                  LED=0X86;
 338                                  ClearGraph();
 339                                  X5045WriteStatus(0x00); 
 340                                  init5045();
 341                                  for(;;){
 342                                  PrintStr(0,0,"X1227 芯片调试 ");
 343                                  temp[0]=time.hour/10+0x30;
 344                                  temp[1]=time.hour%10+0x30;
 345                                  temp[2]=':';
 346                                  temp[3]=time.min/10+0x30;
 347                                  temp[4]=time.min%10+0x30;
 348                                  temp[5]=':';
 349                                  temp[6]=time.sec/10+0x30;
 350                                  temp[7]=time.sec%10+0x30;                       
 351                                  PrintStr(1,0,"时间: ");
 352                                  PrintStr(1,3,temp);
 353          
 354                                  PrintStr(2,0,"日期:");                 
 355                                  PrintStr(3,0,"星期:");
 356                                  watchdog();
 357                                  }
 358          }
 359          */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    321    ----
   CONSTANT SIZE    =      7    ----
   XDATA SIZE       =   ----    ----
C51 COMPILER V7.08   LCD_DISPLAY                                                           10/31/2007 10:13:27 PAGE 7   

   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       3
   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 + -