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

📄 dtt-110.lst

📁 本人做的一款LED控制程序
💻 LST
📖 第 1 页 / 共 4 页
字号:
 241          Uchar Password(void) {
C51 COMPILER V7.50   DTT_110                                                               06/29/2005 09:27:32 PAGE 5   

 242   1              Uchar Pass[6];
 243   1              Uchar x,t,p; 
 244   1              
 245   1              while(1){
 246   2      setpass:if(key_e == 1){key_e = 0; if(x>=6)x=0xff;x++;Discmd=1;}
 247   2                      if(key_c == 1){key_c = 0; Menu2 = 0;for (t=0; t<6; t++) Pass[t]= 0;return(p= 'N');}
 248   2                      if(x<=5){
 249   3                              Pass[x] = Getkey(Pass[x],9);
 250   3                              if(Discmd == 1){
 251   4                                      Discmd = 0;
 252   4                                      ePutstr(0,0,"Password:****** ");
 253   4                                      ePutstr(0,1,"6 Bit 0-9 Number");
 254   4                                      DispOneChar(9+x,0,Pass[x]+0x30);
 255   4                                      Coruscant(9+x,0);
 256   4                              }
 257   3                              goto setpass;
 258   3                      }
 259   2                      p = 0;          
 260   2                      for (t=0; t<6; t++){
 261   3                              if(Pass[t] == Password1[t]) p++;
 262   3                      }
 263   2                      if (p==6){for (t=0; t<6; t++) Pass[t]= 0;return('Y');}
 264   2                  p = 0;              
 265   2                      for (t=0; t<6; t++){
 266   3                              if(Pass[t] == Password2[t]) p++;
 267   3                      }
 268   2                      if (p==6){for (t=0; t<6; t++) Pass[t]= 0;return('Y');}
 269   2                      p = 0;          
 270   2                      for (t=0; t<6; t++){
 271   3                              if(Pass[t] == Password3[t]) p++;
 272   3                      }
 273   2                      if (p==6){for (t=0; t<6; t++) Pass[t]= 0;return('Y');}
 274   2                      x =0;Discmd = 1;             
 275   2              }        
 276   1      }
 277          void SetAccredit(void){ 
 278   1              Uchar x;
 279   1                      
 280   1              while(1){
 281   2                      Uchar a,b;
 282   2      
 283   2                      if(key_e == 1){key_e = 0; if(x>=2)x=0xff;x++;Discmd=1;}
 284   2                      if(key_c == 1){key_c = 0; Menu2 = 0;return;}
 285   2                      if(x == 0) Year = Getkey(Year,99);
 286   2                      if(x == 1) Month = Getkey(Month,12);
 287   2                      if(x == 2) Day = Getkey(Day,30);
 288   2                      if(Discmd == 1){
 289   3                              Discmd = 0;
 290   3                              ePutstr(0,0,"Use Up20  -  -  ");
 291   3                              ePutstr(0,1,"Set Use Date    ");                        
 292   3                              a = Year/10;
 293   3                              b = Year%10;
 294   3                              DispOneChar(8,0,a+0x30);
 295   3                              DispOneChar(9,0,b+0x30);                        
 296   3                              a = Month/10;
 297   3                              b = Month%10;
 298   3                              DispOneChar(11,0,a+0x30);
 299   3                              DispOneChar(12,0,b+0x30);
 300   3                              a = Day/10;
 301   3                              b = Day%10;
 302   3                              DispOneChar(14,0,a+0x30);
 303   3                              DispOneChar(15,0,b+0x30);
C51 COMPILER V7.50   DTT_110                                                               06/29/2005 09:27:32 PAGE 6   

 304   3                              if(x == 0)Coruscant(9,0);
 305   3                              if(x == 1)Coruscant(12,0);
 306   3                              if(x == 2)Coruscant(15,0);
 307   3                      }       
 308   2              }
 309   1              
 310   1              Menu2 = 0;
 311   1      }
 312          
 313          void Setup (void) {
 314   1              
 315   1              if(Menu2==0) {
 316   2                      Menu1 = Getkey(Menu1,9);
 317   2                      if (key_e==1){key_e = 0; Menu2 = 1; Discmd = 1;}
 318   2                      if (Menu1==0){ePutstr(0,0,"Mode Setup      ");}
 319   2                      if (Menu1==1){ePutstr(0,0,"DMX Address     ");}
 320   2                      if (Menu1==2){ePutstr(0,0,"DMX Channel     ");}
 321   2                      if (Menu1==3){ePutstr(0,0,"Clock Setup     ");}
 322   2                      if (Menu1==4){ePutstr(0,0,"Clock Timer     ");}
 323   2                      if (Menu1==5){ePutstr(0,0,"Accredit Date   ");}
 324   2                  if (Menu1==6){ePutstr(0,0,"Program Select  ");}
 325   2                      if (Menu1==7){ePutstr(0,0,"Speed Adjust    ");}
 326   2                      if (Menu1==8){ePutstr(0,0,"Fadetime Adjust ");}
 327   2                      if (Menu1==9){ePutstr(0,0,"Maxout Adjust   ");}
 328   2                                    ePutstr(0,1,"Select To Setup ");
 329   2                      return;
 330   2          }
 331   1                      
 332   1              if (key_c==1) {key_c = 0; Menu2 = 0;}
 333   1                      if (Menu1 == 0){Mode = Getkey(Mode,3);
 334   2                              if(Mode == 0) ePutstr(0,0,"Mode:  DMX In   ");
 335   2                              if(Mode == 1) ePutstr(0,0,"Mode:  Slave    ");
 336   2                              if(Mode == 2) ePutstr(0,0,"Mode:  Master   ");
 337   2                              if(Mode == 3) ePutstr(0,0,"Mode:  Timers   ");
 338   2                                            ePutstr(0,1,"Set Run Mode    ");
 339   2                              return; }
 340   1                      if (Menu1 == 1){  
 341   2                              Dmxaddr = Getkey(Dmxaddr,512);                                             
 342   2                              if(Discmd == 1){ 
 343   3                                      ePutstr(0,0,"Start Addr:     ");
 344   3                                      print(Dmxaddr);Discmd = 0;}
 345   2                                      ePutstr(0,1,"DMX Start Addr  ");
 346   2                                      return; 
 347   2                      }
 348   1                      if (Menu1 == 2){ 
 349   2                              Dmxmode = Getkey (Dmxmode,4);
 350   2                              if(Discmd == 1){ 
 351   3                                      Discmd = 0;
 352   3                                      ePutstr(0,0,"Max Channel:    ");
 353   3                                      ePutstr(0,1,"Set DMX Input CH");
 354   3                                      print(Dmxmode+1);Discmd = 0;}
 355   2                                      return;                 
 356   2                      } 
 357   1                      if (Menu1 == 3){                        
 358   2                              if('Y'== Password())initialize_DS1302();
 359   2                              return; 
 360   2                      }
 361   1                      if (Menu1 == 4){
 362   2                              Timerset();
 363   2                              return;
 364   2                      }
 365   1                      if (Menu1 == 5){
C51 COMPILER V7.50   DTT_110                                                               06/29/2005 09:27:32 PAGE 7   

 366   2                              if('Y'== Password())SetAccredit();
 367   2                              return;
 368   2                      }
 369   1                      if (Menu1 == 6){
 370   2                              Program = Getkey(Program,15);
 371   2                              if (Program == 0) ePutstr(0,0,"Static Black    ");
 372   2                              if (Program == 1) ePutstr(0,0,"Static Red      ");
 373   2                              if (Program == 2) ePutstr(0,0,"Static Grenn    ");
 374   2                              if (Program == 3) ePutstr(0,0,"Static Blue     ");
 375   2                              if (Program == 4) ePutstr(0,0,"Static Yellow   ");
 376   2                              if (Program == 5) ePutstr(0,0,"Static Purple   ");
 377   2                              if (Program == 6) ePutstr(0,0,"Static Cyan     ");
 378   2                              if (Program == 7) ePutstr(0,0,"Static White    ");
 379   2                              if (Program == 8) ePutstr(0,0,"A:R.G.B.Y.P.C.W.");
 380   2                              if (Program == 9) ePutstr(0,0,"A:  R. G. B.    ");
 381   2                              if (Program == 10)ePutstr(0,0,"Roll:  R. G. B. ");
 382   2                              if (Program == 11)ePutstr(0,0,"A:  G. B. P.    ");
 383   2                              if (Program == 12)ePutstr(0,0,"Flash: R. G. B. ");
 384   2                              if (Program == 13)ePutstr(0,0,"Flash: RGBYPCW  ");
 385   2                              if (Program == 14)ePutstr(0,0,"Roll:  RGBYPCW  ");
 386   2                              if (Program == 15)ePutstr(0,0,"    Run All     ");
 387   2                                            ePutstr(0,1,"Select Program  ");
 388   2                              return;
 389   2                      }
 390   1                  if (Menu1 == 7){
 391   2                              Uchar a,b,c;
 392   2                              
 393   2                              Speed = Getkey(Speed,3599);
 394   2                              if (Discmd == 1){
 395   3                                      Discmd = 0;
 396   3                                      if(Speed<=0x3a){
 397   4                                              ePutstr(0,0,"Speed:         S");
 398   4                                              print(Speed+1);
 399   4                                              ePutstr(0,1,"Set Run Speed   ");
 400   4                                              return;
 401   4                                      }
 402   3                                      ePutstr(0,0,"Speed:      .  M");
 403   3                                      a = Speed/60;
 404   3                                      b = a/10;
 405   3                                      c = a%10;
 406   3                                      DispOneChar(10,0,b+0x30);
 407   3                                      DispOneChar(11,0,c+0x30);
 408   3                                      a = Speed%60;
 409   3                                      b = a/10;
 410   3                                      c = a%10;
 411   3                                      DispOneChar(13,0,b+0x30);
 412   3                                      DispOneChar(14,0,c+0x30);
 413   3                                      ePutstr(0,1,"Set Run Speed   ");
 414   3                              }
 415   2                              return;
 416   2                      }
 417   1                      if (Menu1 == 8){
 418   2                              Fadetime = Getkey(Fadetime,100) ;
 419   2                              if (Discmd == 1){
 420   3                                      Discmd = 0;
 421   3                                      ePutstr(0,0,"Fadetime:       ");
 422   3                                      print(Fadetime);
 423   3                                      ePutstr(0,1,"Set Run Fadetime");
 424   3                              }
 425   2                              return;
 426   2                      }
 427   1                      if (Menu1 == 9){
C51 COMPILER V7.50   DTT_110                                                               06/29/2005 09:27:32 PAGE 8   

 428   2                              Maxout = Getkey(Maxout,255) ;
 429   2                              if (Discmd == 1){
 430   3                                      Discmd = 0;
 431   3                                      ePutstr(0,0,"Maxout:         ");
 432   3                                      print(Maxout);
 433   3                                      ePutstr(0,1,"Set Brightness  ");
 434   3                              }
 435   2                              return;
 436   2                      }
 437   1      }
 438          Uchar Checkdate(void) {
 439   1              Uchar  yr, mn, date, dy, hr, min, sec;
 440   1              
 441   1              reset_3w();
 442   1              wbyte_3w(0xbf);                                                 //以多字节突发方式读取时钟数据
 443   1              sec = BCD2HEX(rbyte_3w());                              //秒
 444   1              min = BCD2HEX(rbyte_3w());                              //分
 445   1              hr =  BCD2HEX(rbyte_3w());                              //小时
 446   1              date = BCD2HEX(rbyte_3w());                             //日期
 447   1              mn =  BCD2HEX(rbyte_3w());                              //月份
 448   1              dy =  BCD2HEX(rbyte_3w());                              //星期
 449   1              yr  = BCD2HEX(rbyte_3w());                              //年
 450   1              reset_3w();
 451   1              if(yr>=Year){
 452   2                      if(mn>=Month){
 453   3                              if(date>=Day)
 454   3                                      return('Y');
 455   3                      }               
 456   2              }
 457   1              if(yr>=05){
 458   2                      if(mn>=06)
 459   2                              return('N');
 460   2              }
 461   1              return('Y');            
 462   1      }
 463          Uchar code Ptab1[][3]= {
 464                  000,000,000,
 465                  255,000,000,
 466                  000,255,000,
 467                  000,000,255,
 468                  255,255,000,
 469                  255,000,255,
 470                  000,255,255,
 471                  255,255,255,
 472          };
 473          Uchar code Ptab2[][3]= {        
 474                  000,255,000,
 475                  000,000,255,    
 476                  255,000,255,    
 477          };
 478          Uchar code Ptab3[][3]= {        
 479                  255,000,000,
 480                  000,000,000,
 481                  000,255,000,
 482                  000,000,000,
 483                  000,000,255,
 484                  000,000,000,            
 485          };
 486          Uchar code Ptab4[][3]= {
 487                  000,000,000,

⌨️ 快捷键说明

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