November 23, 2024, 10:58:15 AM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


standard template for our haunt

Started by leucus, September 09, 2009, 04:32:16 PM

Previous topic - Next topic

leucus

john as discussed this is what i am hoping you can throw together

prop 1 controller
ap 8 for sound
your pir for sensor

basically

pir tripped
pause 500
trip sound
trip valve
keep valve open for 4000
valve off
pause 20000
go to main

no this is simple but it would give me a good base to work off of, and get back into figuring out what we are
doing.  thanks in advance

JonnyMac

Here you go!

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Sio     :: Serial IO to EFX-TEK accessories (RC-4, FC-4, etc.)
'            -- clip pin 1 of ULN2803 or replace with ULN2003
'
' Trigger :: Parallax-compatible PIR or N.O. button (mat switch, etc.)
'            -- connect N.O. button between P6.W and P6.R


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  Sio             = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN

SYMBOL  Valve           = PIN0                  ' use V+/OUT0


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  Baud            = OT2400                ' B/R jumper removed


' -----[ Variables ]-------------------------------------------------------

SYMBOL  timer           = B2


' -----[ Initialization ]--------------------------------------------------

Reset:
 PINS = %00000000                              ' preset IOs
 DIRS = %00111111                              ' define output pins (1s)

 SEROUT Sio, Baud, ("!!!!!AP8", %00, "X")      ' kill audio

 PAUSE 20000                                   ' 20s inter-show delay


' -----[ Program Code ]----------------------------------------------------

Main:
 timer = 0                                     ' reset timer

Check_Trigger:
 PAUSE 5                                       ' loop pad
 timer = timer + 5 * Trigger                   ' update timer
 IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input

Start_Audio:
 SEROUT Sio, Baud, ("!AP8", %00, "P", 0)       ' play segement 0

Prop_Control:
 Valve = IsOn
 PAUSE 4000
 Valve = IsOff

 GOTO Reset


' -----[ Subroutines ]-----------------------------------------------------


' -------------------------------------------------------------------------


' -------------------------------------------------------------------------


' -------------------------------------------------------------------------


' -------------------------------------------------------------------------


' -------------------------------------------------------------------------


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office