init: symbol servoPin = 1 gosub close 'no unexpected surprises on powerup high servoPin setint %00000000,%00001000 'watches for IR activity main: pause 100 goto main Interrupt: infrain2 let b0 = infra & %0000001 'First window. The next one will be %00000010 and so on if b0=0 then gosub close else gosub open endif pause 250 high servoPin 'we don't need the servo working to hold position. Friction works just fine in this case setint %00000000,%00001000 'reset the interrupt return open: servo servoPin, 75 pause 800 return close: servo servoPin, 225 pause 800 return