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

📄 suidao1.lst

📁 隧道灯控制 隧道灯控制 隧道灯控制
💻 LST
📖 第 1 页 / 共 3 页
字号:
 241   5                      {
C51 COMPILER V7.50   SUIDAO1                                                               09/26/2007 09:17:54 PAGE 5   

 242   6                              Led1 = 1;Led2 = 1;Led3 = 1;Led4 = 1;
 243   6                              flag1 = 1;
 244   6                              break;
 245   6                      }
 246   5                      case 0x04:
 247   5                      {
 248   6                              Led1 = 0;Led2 = 1;Led3 = 1;Led4 = 1;
 249   6                              flag1 =1;
 250   6                              break;
 251   6                      }
 252   5                      case 0x02:
 253   5                      {
 254   6                              Led1 = 1;Led2 = 0;Led3 = 1;Led4 = 1;
 255   6                              flag1 = 1;
 256   6                              break;
 257   6                      }
 258   5                      case 0x06:
 259   5                      {
 260   6                              Led1 = 1;Led2 = 1;Led3 = 0;Led4 = 1;
 261   6                              flag1 = 1;
 262   6                              break;
 263   6                      }
 264   5                      case 0x01:
 265   5                      {
 266   6                              Led1 = 1;Led2 = 1;Led3 = 1;Led4 = 0;
 267   6                              flag1 = 1;
 268   6                              break;
 269   6                      }
 270   5                      case 0x05:
 271   5                      {
 272   6                              Led1 = 0;Led2 = 1;Led3 = 1;Led4 = 0;
 273   6                              flag1 = 0;
 274   6                              break;
 275   6      
 276   6                      }
 277   5                      case 0x03:
 278   5                      {
 279   6                              Led1 = 1;Led2 = 0;Led3 = 1;Led4 = 0;
 280   6                              flag1 = 0;
 281   6                              break;
 282   6                      }
 283   5                      case 0x07:
 284   5                      {
 285   6                              Led1 = 1;Led2 = 0;Led3 = 0;Led4 = 1;
 286   6                              flag1 = 0;
 287   6                              break;
 288   6                      }
 289   5           }
 290   4      
 291   4      
 292   4      
 293   4        //convert start
 294   4      //      if (adchannel == 0) {
 295   4      
 296   4            //StrTab[][10] = {{"关闭"},{"开路"},{"多个损坏"},{"正常"},{"电流偏大"}};
 297   4      
 298   4      
 299   4                       if(( Led1 == 0 )&&(flag1 == 1 ))
 300   4                      {
 301   5                      outstate1R = 1;
 302   5                      outstate2R = 1;
 303   5                      outstate2G = 1;
C51 COMPILER V7.50   SUIDAO1                                                               09/26/2007 09:17:54 PAGE 6   

 304   5                        if(ad_buf[1]>LIMIT[0][3][1])
 305   5      
 306   5                       outstate1G = 0;
 307   5                    else
 308   5      
 309   5                        outstate1G = 1;}
 310   4                      else if(( Led2 == 0 )&&(flag1 == 1 ))
 311   4                      { outstate1G = 1;
 312   5                      outstate2R = 1;
 313   5                      outstate2G = 1;
 314   5                      if (ad_buf[4]>LIMIT[0][0][1])
 315   5      
 316   5                        outstate1R = 0;
 317   5                    else
 318   5                      outstate1R = 1;
 319   5      
 320   5                      }
 321   4      
 322   4                      else if(( Led4 == 0 )&&(flag1 == 1 ))
 323   4                      {outstate1R = 1;
 324   5                      outstate1G = 1;
 325   5                      outstate2G = 1;
 326   5                      if (ad_buf[2]>LIMIT[0][2][1])
 327   5      
 328   5      
 329   5                       outstate2R = 0;
 330   5                       else
 331   5      
 332   5                      outstate2R = 1;
 333   5      
 334   5                      }
 335   4                     else if(( Led3 == 0 )&&(flag1 == 1 ))
 336   4                      {outstate1R = 1;
 337   5                      outstate1G = 1;
 338   5                      outstate2R = 1;
 339   5                      if (ad_buf[3]>LIMIT[0][1][1])
 340   5                       outstate2G = 0;
 341   5                       else
 342   5      
 343   5                      outstate2G = 1;
 344   5      
 345   5                      }
 346   4                       else if(( Led4 == 0 )&&(flag1 == 0 )&&(Led1 == 0))
 347   4                      {outstate1R = 1;
 348   5                      outstate2G = 1;
 349   5                      if (ad_buf[2]>LIMIT[0][2][1])
 350   5      
 351   5      
 352   5                       outstate2R = 0;
 353   5                       else
 354   5      
 355   5                      outstate2R = 1;
 356   5                       if(ad_buf[1]>LIMIT[0][3][1])
 357   5      
 358   5                       outstate1G = 0;
 359   5                       else
 360   5      
 361   5                        outstate1G = 1;
 362   5                      }
 363   4                      else if(( Led4 == 0 )&&(flag1 == 0 )&&(Led2 == 0))
 364   4                      {
 365   5                      outstate1G = 1;
C51 COMPILER V7.50   SUIDAO1                                                               09/26/2007 09:17:54 PAGE 7   

 366   5                      outstate2G = 1;
 367   5                      if (ad_buf[2]>LIMIT[0][2][1])
 368   5      
 369   5                       outstate2R = 0;
 370   5                       else
 371   5      
 372   5                      outstate2R = 1;
 373   5                       if (ad_buf[4]>LIMIT[0][0][1])
 374   5      
 375   5                        outstate1R = 0;
 376   5                       else
 377   5      
 378   5                      outstate1R = 1;
 379   5                      }
 380   4                      else if(( Led2 == 0 )&&(flag1 == 0 )&&( Led3 == 0 ))
 381   4                      { outstate1G = 1;
 382   5                      outstate2R = 1;
 383   5      
 384   5                      if (ad_buf[4]>LIMIT[0][0][1])
 385   5      
 386   5                        outstate1R = 0;
 387   5                       else
 388   5      
 389   5                      outstate1R = 1;
 390   5                       if (ad_buf[3]>LIMIT[0][1][1])
 391   5      
 392   5                       outstate2G = 0;
 393   5                       else
 394   5      
 395   5                      outstate2G = 1;
 396   5                      }
 397   4                       else
 398   4                       {
 399   5                        outstate1G = 1;
 400   5                        outstate1R = 1;
 401   5                      outstate2R = 1;
 402   5                      outstate2G = 1;
 403   5                      }
 404   4                      state1G = outstate1G;
 405   4                      state1R = outstate1R;
 406   4                      state2G = outstate2G;
 407   4                      state2R = outstate2R;
 408   4      
 409   4      
 410   4      
 411   4                /*if (ad_buf[6] < DimmerYZ[0])
 412   4                        {
 413   4                      if (Dimm1Changed!=2)
 414   4                              {
 415   4                          Dimm1Changed=2;
 416   4                          Dimm1Cnt = DimmChangeTime;
 417   4                         }
 418   4                      else {
 419   4                          if (Dimm1Cnt) Dimm1Cnt--;
 420   4                          else Dimm1 = 2;
 421   4                      }
 422   4                }
 423   4                else if (ad_buf[6] > DimmerYZ[1])
 424   4                        {
 425   4                       if (Dimm1Changed!=0)
 426   4                               {
 427   4                          Dimm1Changed=0;
C51 COMPILER V7.50   SUIDAO1                                                               09/26/2007 09:17:54 PAGE 8   

 428   4                          Dimm1Cnt = DimmChangeTime;
 429   4                         }
 430   4                       else
 431   4                               {
 432   4                          if (Dimm1Cnt) Dimm1Cnt--;
 433   4                          else Dimm1 = 0;
 434   4                       }
 435   4                     }
 436   4                     else {
 437   4                       if (Dimm1Changed!=1) {
 438   4                          Dimm1Changed=1;
 439   4                          Dimm1Cnt = DimmChangeTime;
 440   4                         }
 441   4                       else {
 442   4                          if (Dimm1Cnt) Dimm1Cnt--;
 443   4                          else Dimm1 = 1;
 444   4                       }
 445   4                     }
 446   4      //--------------------------------------------------------
 447   4                if (ad_buf[5] < DimmerYZ[0])
 448   4                        {
 449   4                      if (Dimm2Changed!=2) {
 450   4                          Dimm2Changed=2;
 451   4                          Dimm2Cnt = DimmChangeTime;
 452   4                         }
 453   4                      else {
 454   4                          if (Dimm2Cnt) Dimm2Cnt--;
 455   4                          else Dimm2 = 2;
 456   4                      }
 457   4                }
 458   4                else if (ad_buf[5] > DimmerYZ[1]) {
 459   4                       if (Dimm2Changed!=0) {
 460   4                          Dimm2Changed=0;
 461   4                          Dimm2Cnt = DimmChangeTime;
 462   4                         }
 463   4                       else {
 464   4                          if (Dimm2Cnt) Dimm2Cnt--;
 465   4                          else Dimm2 = 0;
 466   4                       }
 467   4                     }
 468   4                     else {
 469   4                       if (Dimm2Changed!=1) {
 470   4                          Dimm2Changed=1;
 471   4                          Dimm2Cnt = DimmChangeTime;
 472   4                         }
 473   4                       else {
 474   4                          if (Dimm2Cnt) Dimm2Cnt--;
 475   4                          else Dimm2 = 1;
 476   4                       }
 477   4                     }*/
 478   4      
 479   4      //          }//end of adchannel = 0
 480   4      //      adready = 1;
 481   4        }//END OF T100MS
 482   3      
 483   3       }}//end of while (1)
 484   1      }//end of main()
 485          
 486          // ======== Function ========
 487          /*void delay(uint a)

⌨️ 快捷键说明

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