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

📄 timer.lst

📁 This Program Cotains Eeprom Read-write functions, 4 Bit LCD interface routines, Keyboard Interface w
💻 LST
📖 第 1 页 / 共 3 页
字号:
 145   3                      t_i3_on=0;
 146   3               }      else{   in_3_off_flag=0;        t_i3_off=0;}
 147   2      
 148   2                      if(t_i1_on>=on_time_rl1)
 149   2                      {
 150   3                              relay1=0;
 151   3                              in_1_on_flag=0;
 152   3                              t_i1_on=0;
 153   3                              in_1_off_flag=0;
 154   3                              t_i1_off=0;
 155   3                      }
 156   2                      if(t_i2_on>=on_time_rl2)
 157   2                      {
 158   3                              relay2=0;
 159   3                              in_2_on_flag=0;
 160   3                              t_i2_on=0;
 161   3                              in_2_off_flag=0;
 162   3                              t_i2_off=0;
 163   3                      }
 164   2                      if(t_i3_on>=on_time_rl3)
 165   2                      {
 166   3                              relay3=0;
 167   3                              in_3_on_flag=0;
 168   3                              t_i3_on=0;
 169   3                              in_3_off_flag=0;
 170   3                              t_i3_off=0;
 171   3                      }
 172   2                      if(t_i1_off>=off_time_rl1 & i1==1)
 173   2                      {
 174   3                              relay1=1;
 175   3                              in_1_off_flag=0;
 176   3                              t_i1_off=0;
 177   3                      }
 178   2                      if(t_i2_off>=off_time_rl2 & i2==1)
 179   2                      {
C51 COMPILER V7.50   TIMER                                                                 03/30/2006 19:28:31 PAGE 4   

 180   3                              relay2=1;
 181   3                              in_2_off_flag=0;
 182   3                              t_i2_off=0;
 183   3                      }
 184   2                      if(t_i3_off>=off_time_rl3 & i3==1)
 185   2                      {
 186   3                              relay3=1;
 187   3                              in_3_off_flag=0;
 188   3                              t_i3_off=0;
 189   3                      }
 190   2                      
 191   2                      if(P2!=0xff)
 192   2                              key_pressed();
 193   2              }
 194   1      }       // End of Main routine.
 195          key_pressed()
 196          {
 197   1      delay(1500);
 198   1      switch(P2)
 199   1                      {                       
 200   2                              case 0x7f :                     //      SET key
 201   2                                                      clear_lcd();
 202   2                                                      if(screen_no==0)        
 203   2                                                      {
 204   3                                                              screen_no=1;
 205   3                                                              write_LCD_line(LINE_1,"I/P 1 ON TIME:");
 206   3                                                              char_sel=1;
 207   3                                                              ccc1=on_time1_rl1;
 208   3                                                              ccc2=on_time2_rl1;
 209   3                                                              ccc3=on_time3_rl1;
 210   3                                                      }
 211   2                                                      else if(screen_no==1)
 212   2                                                      {       
 213   3                                                              on_time1_rl1=ccc1;
 214   3                                                              on_time2_rl1=ccc2;
 215   3                                                              on_time3_rl1=ccc3;
 216   3                                                              on_time_rl1=on_time1_rl1+(10*on_time2_rl1)+(100*on_time3_rl1);
 217   3                                                              ee_byte_to_ee(0x0b,on_time1_rl1);delay(10);
 218   3                                                              ee_byte_to_ee(0x1b,on_time2_rl1);delay(10);
 219   3                                                              ee_byte_to_ee(0x2b,on_time3_rl1);delay(10);
 220   3                                                              screen_no=2;
 221   3                                                              write_LCD_line(LINE_1,"I/P 2 ON TIME:");
 222   3                                                              char_sel=1;
 223   3                                                              ccc1=on_time1_rl2;
 224   3                                                              ccc2=on_time2_rl2;
 225   3                                                              ccc3=on_time3_rl2;
 226   3                                                      }
 227   2                                                      else if(screen_no==2)   
 228   2                                                      {       
 229   3                                                              on_time1_rl2=ccc1;
 230   3                                                              on_time2_rl2=ccc2;
 231   3                                                              on_time3_rl2=ccc3;
 232   3                                                              on_time_rl2=on_time1_rl2+(10*on_time2_rl2)+(100*on_time3_rl2);
 233   3                                                              ee_byte_to_ee(0x4b,on_time1_rl2);                  delay(10);
 234   3                                                              ee_byte_to_ee(0x5b,on_time2_rl2);       delay(10);
 235   3                                                              ee_byte_to_ee(0x6b,on_time3_rl2);delay(10);
 236   3                                                              screen_no=3;
 237   3                                                              write_LCD_line(LINE_1,"I/P 3 ON TIME:");
 238   3                                                              char_sel=1;
 239   3                                                              ccc1=on_time1_rl3;
 240   3                                                              ccc2=on_time2_rl3;
 241   3                                                              ccc3=on_time3_rl3;
C51 COMPILER V7.50   TIMER                                                                 03/30/2006 19:28:31 PAGE 5   

 242   3                                                      }
 243   2                                                      else if(screen_no==3)   
 244   2                                                      {       
 245   3                                                              on_time1_rl3=ccc1;
 246   3                                                              on_time2_rl3=ccc2;
 247   3                                                              on_time3_rl3=ccc3;
 248   3                                                              on_time_rl3=on_time1_rl3+(10*on_time2_rl3)+(100*on_time3_rl3);
 249   3                                                              ee_byte_to_ee(0x7b,on_time1_rl3);       delay(10);
 250   3                                                              ee_byte_to_ee(0x8b,on_time2_rl3);       delay(10);
 251   3                                                              ee_byte_to_ee(0x9b,on_time3_rl3);       delay(10);
 252   3                                                              screen_no=4;
 253   3                                                              write_LCD_line(LINE_1,"I/P 1 OFF TIME:");
 254   3                                                              char_sel=1;
 255   3                                                              ccc1=off_time1_rl1;
 256   3                                                              ccc2=off_time2_rl1;
 257   3                                                              ccc3=off_time3_rl1;
 258   3                                                      }
 259   2                                                      else if(screen_no==4)   
 260   2                                                      {       
 261   3                                                              off_time1_rl1=ccc1;
 262   3                                                              off_time2_rl1=ccc2;
 263   3                                                              off_time3_rl1=ccc3;
 264   3                                                              off_time_rl1=off_time1_rl1+(10*off_time2_rl1)+(100*off_time3_rl1);
 265   3                                                              ee_byte_to_ee(0xab,off_time1_rl1);      delay(10);
 266   3                                                              ee_byte_to_ee(0xbb,off_time2_rl1);      delay(10);
 267   3                                                              ee_byte_to_ee(0xcb,off_time3_rl1);      delay(10);
 268   3                                                              screen_no=5;
 269   3                                                              write_LCD_line(LINE_1,"I/P 2 OFF TIME:");
 270   3                                                              char_sel=1;
 271   3                                                              ccc1=off_time1_rl2;
 272   3                                                              ccc2=off_time2_rl2;
 273   3                                                              ccc3=off_time3_rl2;
 274   3                                                              
 275   3                                                      }
 276   2                                                      else if(screen_no==5)   
 277   2                                                      {       
 278   3                                                              off_time1_rl2=ccc1;
 279   3                                                              off_time2_rl2=ccc2;
 280   3                                                              off_time3_rl2=ccc3;
 281   3                                                              off_time_rl2=off_time1_rl2+(10*off_time2_rl2)+(100*off_time3_rl2);
 282   3                                                              ee_byte_to_ee(0xdb,off_time1_rl2);      delay(10);
 283   3                                                              ee_byte_to_ee(0xeb,off_time2_rl2);      delay(10);
 284   3                                                              ee_byte_to_ee(0x43,off_time3_rl2);      delay(10);
 285   3                                                              screen_no=6;
 286   3                                                              write_LCD_line(LINE_1,"I/P 3 OFF TIME:");
 287   3                                                              char_sel=1;
 288   3                                                              ccc1=off_time1_rl3;
 289   3                                                              ccc2=off_time2_rl3;
 290   3                                                              ccc3=off_time3_rl3;
 291   3                                                              
 292   3                                                      }
 293   2                                                      else if(screen_no==6)   
 294   2                                                      {       
 295   3                                                              off_time1_rl3=ccc1;
 296   3                                                              off_time2_rl3=ccc2;
 297   3                                                              off_time3_rl3=ccc3;

⌨️ 快捷键说明

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