'********************* 'Electronic mouse trap ' 11/6/2012 'Ver 4 '********************* 'Variables symbol value = b0 symbol counter = b1 'Constants symbol Motor = 4 symbol Beam = 3 symbol IRLED = 1 symbol LEDLamp =0 'Intro tune For counter = 1 to 2 tune 0, 6,($20,$23,$20,$23) ' Play intro tune Next counter 'Fast LED Flash to show power is on For counter = 1 to 10 high LEDLamp pause 50 low LEDLamp pause 50 Next counter 'Main monitoring loop Main: high IRLed 'IR on high LEDLamp 'Flash LED low LEDLamp 'LED off pause 5 'Wait for photo diode to settle if pin3 = 1 then 'Beam is interrupted low IRLed 'IR off goto Trip 'Trip the Latch end if low IRLed 'IR off pause 1000 'All off for battery conservation Goto main 'Trigger latch Trip: high motor 'Spring the Latch pause 75 'Only for a Burst low motor 'Motor off 'Slow Flash LED and Got one tune. Stay in this loop until power is reset. Flash: high LEDLamp pause 20 low LEDLamp play 2, 0 'Play the got one tune for counter = 1 to 15 pause 60000'Pause loop for Battery conservation. next counter goto Flash