38
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
38
Supported by:
Program 2
' ***** main loop *****
' loop here checking sensors
main:
' LED off
low 0
' read light value
readadc 1,b1
' if analogue value low then activate alarm
if b1 < 40 then alarm
' if switch off do tamper
if pin3 = 0 then tamper
goto main
' ***** tamper - beep until switch shut *****
tamper:
high 0
sound 2,(120,100)
if pin3 = 1 then main
goto tamper
' ***** alarm output on forever ****
alarm:
high 4
goto alarm
A
CKNOWLEDGEMENT
This project development was funded by the UK
Offshore Oil and Gas Industry.
www.oilandgas.org.uk/education/
(c) Revolution Education Ltd 2002
www.rev-ed.co.uk
All rights reserved.
May be photocopied for non-commercial educational
use in classrooms in schools and colleges only.
PICAXE is a trademark of Revolution Education Ltd