;********* SIREN ALARM SYSTEM USING PASSIVE INFRARED PIR SENSOR********** ;Change START UP ROUTINE with an LED or Speaker ;Change SIREN BLAST routine with a new siren sound #Picaxe08M2 #No_Data ;******************Start Up Routine********************************* ; Put your start up routine Here! ;******************START OF MAIN LOOP***************************** main: if pin3 = 1 then gosub siren_blast ;when switch is pushed go subroutine siren_blast nap 4 ; small low power sleep goto main ;****************END OF MAIN LOOP******************************* siren_blast: ;Use PWMOUT to make a siren sound high 4 ;Turn the LED on Pin4 for b0 = 90 to 145 step 2 ;Change b0 values to lower, slower,faster for b5 = 10 to 30 step 10 ;Change B5 steps b1 = b0 ;/ 233 / 100; 144 pwmout pwmdiv4, 2, b0, 309 pwmout pwmdiv4, 2, b1, 309 pause b5 next b5 next ; for b0 = 145 to 90 step -2 ;Change b0 values to lower, slower,faster for b5 = 10 to 30 step 10 b1 = b0 ;/ 233 / 100; 144 pwmout pwmdiv4, 2, b0, 309 pwmout pwmdiv4, 2, b1, 309 pause b5 next b5 next INPUT 2 ;Shutdown electrical noise caused by PWM low 4 ; Turn off the LED on Pin4 return