' (c) 2007 Garage of Evil ' http://www.garageofevil.com ' ' this program will watch for the PIR sensor to trigger on PIN7, and then ' trigger the AP-8 to play it's audio, and then wait 60 seconds before doing it ' again... ' ' {$STAMP BS1} ' {$PBASIC 1.0} SYMBOL Audio = 0 ' AP-8 is on P0 SYMBOL PIRSensor = PIN7 ' input trigger on P7 SYMBOL IsOff = 0 SYMBOL IsOn = 1 Reset: DIRS = %00111111 ' make P7-P6 inputs, P5-P0 outputs PINS = %00000000 ' all outputs off Main: TryAgain: 'DEBUG "..CHECKING.." IF PIRSensor = IsOff THEN TryAgain ' wait until trigger is activated 'DEBUG " SENSOR TRIGGERED! " SEROUT Audio, OT2400, ("!AP8", %11, "P", 0) PAUSE 60000 ' wait 60 seconds GOTO Main ' repeat forever END