NEW 1 C=240 2 F=0 3 LOOP 8 4 READEE C 5 G=A 6 GOSUB 40 7 A=C 8 A=A+1 9 C=A 10 A=F 11 A=A+1 12 F=A 13 ENDLOOP 20 READIR 21 IF A=0 20 22 A=F 23 B=7 24 IF A>B 20 25 LED=1 26 DELAY 5 27 LED=0 28 READIR 29 IF A<>0 28 30 A=240 31 B=F 32 A=A+B 33 C=A 34 READEE C 35 A=A+1 36 G=A 37 WRITEEE C 38 GOSUB 40 39 GOTO 20 40 A=F 41 A=A*2 42 A=A+50 43 GOTO A 50 RELAY1=G 51 RETURN 52 RELAY2=G 53 RETURN 54 RELAY3=G 55 RETURN 56 RELAY4=G 57 RETURN 58 RELAY5=G 59 RETURN 60 RELAY6=G 61 RETURN 62 RELAY7=G 63 RETURN 64 RELAY8=G 65 RETURN this line and the lines below are comments and can be removed with a text editor or the errors caused by trying to upload them can be ignored ------------------------------- irrelayt.tmb for the RC51-IR Waits for IR transmission from handheld remote control unit, toggles relays on and off based only on Function code. Saves state of relays in EEPROM so that when RC51 is power cycled the relays will go to the last state to which they were set. When program is run for the first time after loading it the realys will initialize to on because the EEPROM will have been erased. relay 1 = button 1, code 0 relay 2 = button 2, code 1 relay 3 = button 3, code 2 relay 4 = button 4, code 3 relay 5 = button 5, code 4 relay 6 = button 6, code 5 relay 7 = button 7, code 6 relay 8 = button 8, code 7