34
PICAXE-08 ALARM PROJECT
revolution
© copyright 2002 - AXE102 Alarm Student Project Notes Version 1.1
Revolution Education Ltd. Email: [email protected] Web: www.rev-ed.co.uk
34
Supported by:
Step 6 – Test the piezo
Type in and download the following program:
main:
sound 2,(65,100)
sound 2,(78,100)
sound 2,(88,100)
sound 2,(119,100)
goto main
The piezo should make 4 different noises. If it does
not make sure the wires are correctly soldered, that
it is stuck on the brass side with a sticky pad (it will
not work if ‘hanging loose’) and that the wire link
over the letters PX is on the board.
Step 7 – Test the switch
Connect a switch to the digital input.
Type in and download the following program.
main:
make a label called main
if input3 is on then flash
jump if the input is on
goto main
else loop back around
flash:
make a label called flash
high 0
switch output 0 on
wait 2
wait 2 seconds
low 0
switch output 0 off
goto main
jump back to start
The LED on output 0 should light whenever the switch is pushed. If it does not check
that the switch and 10k resistors are correctly soldered.
start
high 0
low 0
pin3=1
Y
N
wait 2
start
sound 2,(65,100)
sound 2,(78,100)
sound 2,(88,100)
sound 2,(119,100)