'PICAXE code for IR Switch Main: low 0 b0=0 if pin2=1 then Lightcheck goto main lightcheck: b0=0 for b0=0 to 120 pause 50 if pin2=0 then lightcheck next b0 toggle 0 Light: wait 5 goto lightcheck