Appendix B: Camera Code
' -----[ I/O Definitions ]---------------------------------------------
shutter VAR PortC.4
power VAR PortC.6
tripped VAR PortD.1
sys_arm VAR PortD.2
' -----[ Constants ]---------------------------------------------------
i VAR BYTE
' -----[ Program Code ]------------------------------------------------
Main:
i = 1
Low tripped
Low shutter
Low power
low sys_arm
TRISC.4 = 0 'set PortC.4 to an output
TRISC.6 = 0 'set PortC.6 to an output
TRISD.1 = 1 'set PortD.1 to an input
TRISD.2 = 1 'set PortD.2 to an input
GoSub LCD_Initialize
LCDOut "Welcome To The"
Pause 1000
LCDOUT $FE, $C0 'Cursor to beginning of 2nd line
LCDOUT "Camera Program"
armed:
IF sys_arm then
goto check_sensor
else
goto armed
endif
check_sensor:
IF tripped Then
pulsout power, 500
GoSub LCD_Initialize
LCDOut "Alarm Actived"
Pause 2000
Loop:
For i = 1 TO 5
Pulsout shutter, 500
GoSub LCD_Initialize
LCDOut "Picture Taken"
Pause 500
Gosub LCD_Initialize
LCDOUt "Between snapshots"
Pause 8000
Next i
Comments to this Manuals