'Motion sensor and MP3 control 'picaxe 08M 4 MHZ let dirs = %00000001 'Set pin1 to output all others to input low 1 'set pin 1 low so that it does not start the MP3 player for b0 = 1 to 6 pause 10000 next b0 '1 minute pause to settle motion sensor ifmotion: if pin2 = 1 then MP3start 'test to see if the motion sensor detects motion pause 10 goto ifmotion MP3start: high 1 'star playback pause 2000 low 1 'play for 20 seconds pause 20000 high 1 'pause for 7 seconds pause 200 low 1 pause 7000 high 1 'restart playback for 10 seconds pause 200 low 1 pause 10000 high 1 'shut player off pause 3000 low 1 pause 2000 '2 second pause before testing the motion sensor again goto ifmotion