'this slave program acts as its own timer after receiving timing data from master 'for timed mode pres 1 in master to select slave 1; then 1 on master to select timed mode 'next enter time as hhmmss 'After timed setting is in progress it can be cancelled by pressing 1 to select slave 'then 4 to cancel timing period 'in toggle mode, on remote press 1 to select slave then 2 to turn device on ' and press 1 to select slave then 3 to turn off 'pairs with master program "switch1" symbol m = b1 symbol s = b0 symbol hr = b2 symbol sec = w0 hsersetup b1200_4,0 slave: serin c.3,t1200,("A1"),b6 'wait for master serout c.2,t1200,(85,"A1","1") 'acknowledge with 1 on b6 gosub troff,tron,timed 'turn on or off depending on value of b6 goto slave tron:high c.4:return 'b6 = 1 signifies turn on troff:low c.4:return 'b6 = 2 signifies turn off timed: serin c.3,t1200,("A1"),hr,m,s 'wait for master serout c.2,t1200,(85,"A1","1") 'acknowledge with 1 sec = m*60 + s if sec = 0 then goto cont time = 0 high c.4 secloop: if time < sec then hserin b7 hserin b7 hserin b7 if b7 = "1" then goto finished goto secloop endif cont: time = 0 high c.4 hrloop: if hr = 0 then low c.4 goto slave endif loop0: if time < 3600 then hserin b7 hserin b7 hserin b7 if b7 = "1" then goto finished goto loop0 endif time = 0 dec hr goto hrloop finished: serout c.2,t1200,(85,"A1","1") 'acknowledge with 1 low c.4 return