November 22, 2024, 10:26:00 PM

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.


program request for Prop-1, AP-8, RC-4 in Monster-in-a-Box pop-up

Started by dbauer1080, October 21, 2008, 01:37:41 AM

Previous topic - Next topic

dbauer1080

Jon,

Hopefully this request is straightforward.

This is a pop-up in a box, with AP-8 giving initial background sound and then a scream at pop-up, all on the same segment. Prop-1 activates 2 LED eyes, RC-4 activates a 110v AC solenoid, a strobe, and a fogger remote.

Here are the timings in minute/second format:

0:00 PIR is activated. AP-8 plays segment 0 that lasts a total of 26 seconds. Two LED eyes on skull on the outside of box turned on by Prop-1. Fogger                   
        also turned  on via RC-4 K1.
0:11 AC solenoid is activated via RC-4 K2 to pop different skull from inside of box. Strobe is turned on via RC-4 K3. Fogger turned off.
0:26 AP-8 segment ends. Solenoid deactivated, LED's off, strobe off.

Delay 1 minute before next activation.

Thanks again for your great service. Please let me know of any questions/details.

JonnyMac

You'll probably have to adjust the two bit PAUSE statements to get the timing just right, but this should do it for you.

' =========================================================================
'
'   File......
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2008 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  Eyes            = PIN0                  ' P0 or 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  relays          = B0
SYMBOL   Fogger         =  BIT0                 ' on K1
SYMBOL   PopUp          =  BIT1                 ' on K2
SYMBOL   Strobe         =  BIT2                 ' on K3

SYMBOL  timer           = B2
SYMBOL  sfx             = B3


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

Reset:
  PINS = %00000000                              ' clear all
  DIRS = %00000001                              ' set outputs

  SEROUT Sio, Baud, ("!!!!!AP8", %00, "X", "!RC4", %00, "X")
  relays = %0000

  PAUSE 60000                                   ' warm-up/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

  sfx = 0
  GOSUB Play_AP8

  Fogger = IsOn
  GOSUB Set_RC4

  Eyes = IsOn
  PAUSE 11000

  PopUp = IsOn
  Strobe = IsOn
  Fogger = IsOff
  GOSUB Set_RC4
  PAUSE 15000

  GOTO Reset                                    ' everything off


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

Play_AP8:
  SEROUT Sio, Baud, ("!AP8", %00, "P", sfx)
  RETURN

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

Set_RC4:
  SEROUT Sio, Baud, ("!RC4", %00, "S", relays)
  RETURN

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


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


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

dbauer1080