PDA

View Full Version : Picaxe PIR Sensor (my first project)



Neon_C
03-01-2010, 06:52
Hello Everyone!
I got a picaxe 28x1 and protoboard for christmass and this is my first project. I'm using a parallax PIR module.

See Video (http://www.youtube.com/watch?v=CYe08a7Ad3w)

and my code


main:
b0 = 1
do 'pir warmup period
high 0 'turn on wiat led
pause 250
low 0
pause 250
b0 = b0 + 1
loop while b0 < 40

pause 10000 'pause for 10 seconds
low 0 'turn off wait led
setint %00000001, %00000001 'set interrupt
do
pause 2000 'wait
loop

interrupt:
b0 = 0

do
high 1
pause 500
low 1
pause 500
b0 = b0 + 1
loop while b0 < 10

high 0 'turn on wait led
pause 10000 'wait 10 seconds before restarting interrupt
low 0 ' turn off wait led
setint %00000001, %00000001 'turn interrupt back on

return



Questions comments thoughts all welcome!

Dippy
03-01-2010, 10:13
Happy Christmas Neon.

As a first project you've done better than most.
Well done.

Neon_C
04-01-2010, 04:00
Thanks Dippy. I appricate it!