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

📄 dzkzqv12.lst

📁 LED照明行业地砖及护栏控制器程序 从现况来看
💻 LST
📖 第 1 页 / 共 3 页
字号:
 317   1      }
 318          //**************************************
 319          void    save(void)
 320          {
 321   1      uchar i;
 322   1      uchar xdata *sp;
 323   1      sp=&send_buf[1];
 324   1      for(i=0;i<7;i++)
 325   1              {
 326   2              Write24c02(sp,i*16,16);
 327   2              sp+=16;
 328   2              }
 329   1      }
 330          
 331          //**************************
 332          //七种颜色渐变
 333          //*****************************
 334          void col7(uchar SPEEDCOL)
 335          {
 336   1      uchar i;
 337   1      for(i=0;i<255;i++)
 338   1              {dis_red[0]=i;
 339   2              televise(0);
 340   2              delay(SPEEDCOL*200);
 341   2              }
 342   1      delay1s(SPEEDCOL);
 343   1      //----------------------------
 344   1      for(i=0;i<255;i++)
 345   1              {dis_grn[0]=i;
 346   2              televise(0);
 347   2              delay(SPEEDCOL*200);
 348   2              }
 349   1      delay1s(SPEEDCOL);
 350   1      //----------------------------
 351   1      for(i=255;i>0;i--)
 352   1              {dis_red[0]=i;
 353   2              televise(0);
 354   2              delay(SPEEDCOL*200);
 355   2              }
 356   1      delay1s(SPEEDCOL);
 357   1      //----------------------------
 358   1      for(i=0;i<255;i++)
 359   1              {dis_blu[0]=i;
 360   2              televise(0);
 361   2              delay(SPEEDCOL*200);
 362   2              }
 363   1      delay1s(SPEEDCOL);
 364   1      //----------------------------
 365   1      for(i=255;i>0;i--)
C51 COMPILER V7.50   DZKZQV12                                                              12/04/2006 16:43:31 PAGE 7   

 366   1              {dis_grn[0]=i;
 367   2              televise(0);
 368   2              delay(SPEEDCOL*200);
 369   2              }
 370   1      delay1s(SPEEDCOL);
 371   1      //----------------------------
 372   1      for(i=0;i<255;i++)
 373   1              {dis_red[0]=i;
 374   2              televise(0);
 375   2              delay(SPEEDCOL*200);
 376   2              }
 377   1      delay1s(SPEEDCOL);
 378   1      //---------------------------
 379   1      for(i=0;i<255;i++)
 380   1              {dis_grn[0]=i;
 381   2              televise(0);
 382   2              delay(SPEEDCOL*200);
 383   2              }
 384   1      delay1s(SPEEDCOL);
 385   1      }
 386          //**************************
 387          //将数据广播发送
 388          //*****************************
 389          void televise(uchar add)
 390          {
 391   1      TB81=1;
 392   1      SBUF1=add;while(!TI1);TI1=0;
 393   1      TB81=0;
 394   1      send_del(20);
 395   1      SBUF1=dis_red[0];
 396   1      while(!TI1);TI1=0;
 397   1      send_del(20);
 398   1      SBUF1=dis_grn[0];
 399   1      while(!TI1);TI1=0;
 400   1      send_del(20);
 401   1      SBUF1=dis_blu[0];
 402   1      while(!TI1);TI1=0;
 403   1      send_del(20);
 404   1      led=!led;
 405   1      }
 406          //********************
 407          //七彩展开
 408          //********************
 409          void    qczk(uchar speed)
 410          {
 411   1      uchar i;
 412   1      dis_red[0]=255;
 413   1      dis_grn[0]=0;
 414   1      dis_blu[0]=0;
 415   1      for(i=0;i<XX+1;i++)
 416   1              {
 417   2              televise(i);
 418   2              delay(speed*200);
 419   2              }
 420   1      dis_red[0]=255;
 421   1      dis_grn[0]=255;
 422   1      dis_blu[0]=0;
 423   1      for(i=0;i<XX+1;i++)
 424   1              {
 425   2              televise(i);
 426   2              delay(speed*200);
 427   2              }
C51 COMPILER V7.50   DZKZQV12                                                              12/04/2006 16:43:31 PAGE 8   

 428   1      dis_red[0]=0;
 429   1      dis_grn[0]=255;
 430   1      dis_blu[0]=0;
 431   1      for(i=0;i<XX+1;i++)
 432   1              {
 433   2              televise(i);
 434   2              delay(speed*200);
 435   2              }
 436   1      dis_red[0]=0;
 437   1      dis_grn[0]=255;
 438   1      dis_blu[0]=255;
 439   1      for(i=0;i<XX+1;i++)
 440   1              {
 441   2              televise(i);
 442   2              delay(speed*200);
 443   2              }
 444   1      dis_red[0]=0;
 445   1      dis_grn[0]=0;
 446   1      dis_blu[0]=255;
 447   1      for(i=0;i<XX+1;i++)
 448   1              {
 449   2              televise(i);
 450   2              delay(speed*200);
 451   2              }
 452   1      dis_red[0]=255;
 453   1      dis_grn[0]=0;
 454   1      dis_blu[0]=255;
 455   1      for(i=0;i<XX+1;i++)
 456   1              {
 457   2              televise(i);
 458   2              delay(speed*200);
 459   2              }
 460   1      dis_red[0]=255;
 461   1      dis_grn[0]=255;
 462   1      dis_blu[0]=255;
 463   1      for(i=0;i<XX+1;i++)
 464   1              {
 465   2              televise(i);
 466   2              delay(speed*200);
 467   2              }
 468   1      
 469   1      }
 470          //**************************
 471          //加清除显示内存
 472          //*****************************
 473          void clear(void)
 474          {
 475   1      uchar i;
 476   1      for(i=0;i<XX;i++)
 477   1              {
 478   2              dis_red[i]=0;
 479   2              dis_grn[i]=0;
 480   2              dis_blu[i]=0;
 481   2              }
 482   1      }
 483          //*******************************
 484          //左展开
 485          //********************************
 486          void duun(uchar speed)
 487          {
 488   1      uchar x;
 489   1      for(x=0;x<XX;x++)
C51 COMPILER V7.50   DZKZQV12                                                              12/04/2006 16:43:31 PAGE 9   

 490   1              {
 491   2              dis_red[x]=x64cr[x];
 492   2              dis_grn[x]=x64cg[x];
 493   2              dis_blu[x]=x64cb[x];
 494   2              sendall();
 495   2              delay(speed);
 496   2              }
 497   1      delay1s(speed);
 498   1      }
 499          //*******************************
 500          //左百叶展开
 501          //********************************
 502          void zbyzk(uchar speed)
 503          {
 504   1      uchar x,i;
 505   1      for(i=0;i<4;i++)
 506   1              {for(x=0;x<XX/4;x++)
 507   2                      {
 508   3                      dis_red[x*4+i]=x64cr[x];
 509   3                      dis_grn[x*4+i]=x64cg[x];
 510   3                      dis_blu[x*4+i]=x64cb[x];
 511   3                      }
 512   2              sendall();
 513   2              delay1s(speed);
 514   2              }
 515   1      }
 516          //*******************************
 517          //左百叶闭幕
 518          //********************************
 519          void zbybm(uchar speed)
 520          {
 521   1      uchar x,i;
 522   1      for(i=0;i<4;i++)
 523   1              {for(x=0;x<XX/4;x++)
 524   2                      {
 525   3                      dis_red[x*4+i]=0;
 526   3                      dis_grn[x*4+i]=0;
 527   3                      dis_blu[x*4+i]=0;
 528   3                      }
 529   2              sendall();
 530   2              delay1s(speed);
 531   2              }
 532   1      }
 533          
 534          //*******************************
 535          //右百叶展开
 536          //********************************
 537          void ybyzk(uchar speed)
 538          {
 539   1      uchar x,i;
 540   1      for(i=3;i<254;i--)
 541   1              {for(x=0;x<XX/4;x++)
 542   2                      {
 543   3                      dis_red[x*4+i]=x64cr[x];
 544   3                      dis_grn[x*4+i]=x64cg[x];
 545   3                      dis_blu[x*4+i]=x64cb[x];
 546   3                      }
 547   2              sendall();
 548   2              delay1s(speed);
 549   2              }
 550   1      }
 551          //*******************************
C51 COMPILER V7.50   DZKZQV12                                                              12/04/2006 16:43:31 PAGE 10  

 552          //右百叶闭幕
 553          //********************************
 554          void ybybm(uchar speed)
 555          {
 556   1      uchar x,i;
 557   1      for(i=3;i<254;i--)
 558   1              {for(x=0;x<XX/4;x++)
 559   2                      {
 560   3                      dis_red[x*4+i]=0;
 561   3                      dis_grn[x*4+i]=0;
 562   3                      dis_blu[x*4+i]=0;
 563   3                      }
 564   2              sendall();
 565   2              delay1s(speed);
 566   2              }
 567   1      }
 568          //*******************************
 569          //从中间向两边展开
 570          //*******************************
 571          void mlrun(uchar speed)
 572          {
 573   1      uchar x;
 574   1      for(x=0;x<X1;x++)
 575   1              {
 576   2              dis_red[x+X1]=x64cr[x+X1];dis_red[X1-x]=x64cr[X1-x];
 577   2              dis_grn[x+X1]=x64cg[x+X1];dis_grn[X1-x]=x64cg[X1-x];
 578   2              dis_blu[x+X1]=x64cb[x+X1];dis_blu[X1-x]=x64cb[X1-x];
 579   2              sendall();
 580   2              }
 581   1      delay1s(speed);
 582   1      }
 583          //*******************************
 584          //从中间向两边闭幕
 585          //**********************************
 586          void mlrco(uchar speed)
 587          {
 588   1      uchar x;
 589   1      for(x=X1;x<XX;x++)
 590   1              {
 591   2              dis_red[x]=0;dis_red[XX-1-x]=0;
 592   2              dis_grn[x]=0;dis_grn[XX-1-x]=0;
 593   2              dis_blu[x]=0;dis_blu[XX-1-x]=0;
 594   2              sendall();
 595   2              }
 596   1      delay1s(speed);
 597   1      }
 598          //*******************************
 599          //两边向中间展开
 600          //**********************************
 601          void lrmun(uchar speed)
 602          {
 603   1      uchar x;
 604   1      for(x=XX-1;x>X1;x--)
 605   1              {
 606   2              dis_red[x]=x64cr[x];dis_red[XX-1-x]=x64cr[XX-1-x];
 607   2              dis_grn[x]=x64cg[x];dis_grn[XX-1-x]=x64cg[XX-1-x];
 608   2              dis_blu[x]=x64cb[x];dis_blu[XX-1-x]=x64cb[XX-1-x];
 609   2              sendall();
 610   2              }
 611   1      delay1s(speed);
 612   1      }
 613          //*******************************
C51 COMPILER V7.50   DZKZQV12                                                              12/04/2006 16:43:31 PAGE 11  

 614          //两边向中间闭幕
 615          //**********************************
 616          void lrmco(uchar speed)
 617          {
 618   1      uchar x;
 619   1      for(x=0;x<X1;x++)
 620   1              {
 621   2              dis_red[x]=0;dis_red[XX-1-x]=0;
 622   2              dis_grn[x]=0;dis_grn[XX-1-x]=0;
 623   2              dis_blu[x]=0;dis_blu[XX-1-x]=0;
 624   2              sendall();
 625   2              }
 626   1      delay1s(speed);
 627   1      }
 628          //*******************************
 629          //中间向两边移出
 630          //**********************************
 631          void mlrmov(uchar speed)
 632          {
 633   1      uint i,x;
 634   1      uchar code *ROMP;
 635   1      ROMP=0x2000;
 636   1      for(x=0;x<XX;x++)
 637   1              {
 638   2              dis_red[x]=0;//清屏
 639   2              dis_grn[x]=0;//清屏
 640   2              dis_blu[x]=0;//清屏
 641   2              }

⌨️ 快捷键说明

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