November 23, 2024, 11:04:19 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


custom program for screaming lady

Started by sinstar, August 18, 2011, 06:11:49 PM

Previous topic - Next topic

sinstar

I'm trying to use your controllers for the first time.  I can"t find a program that will fit my needs.  I'm sure you guys will be able to write me one. 
I will explain the scene. 
The patron turns a door knob that closes a switch that starts a motor.  The door has windows, behind it is a mannequin attached to a motor (120V. @ 6A.) that shakes back and forth.  Then the sound of screaming is triggered (cowlacious board).  There is a series of 4 lights facing the mannequin.  The first light upper left on 2sec. then upper right 2sec. lower right 2 sec. then lower left 2sec. repeat a little faster 1.5 sec then faster 1sec. then faster .75sec then .5 sec.  some time within the action a strobe light or air blast will be triggered whichever works the best.  Light are still spinning around now at .5 sec, but now  2 lights at a time are going(Upper left and lower right vice versa).  still dropping in duration .4sec, .35,.3,.25.  Then lights stop, and. the motor that shakes the mannequin stops shaking.   Scream sound track will end somewhere between 1-5 seconds afterwards.  Then there's a pause 30-45 seconds.,  Goes back to main or resets until the next patron turns the handle.         

1.    p6 open & close switch starts the sequence   
2.    p5 closes a relay (12v.) that starts a 120v. motor that runs till the light sequence is
        done or I could adjust as required
3.    p7 sends a signal to the sound board to start. right after motor starts must be variable
        to get it right.
4.    p4 closes a relay (12v.) air blast or strobe duration adjustable 

   
5.    p3 light upper left       
6.    p2 light upper right
7.    p1 light lower right
8.    p0 light lower left   


JonnyMac

This will get you started.  Note that I put the elapsed time (from trigger) in comments so that you can see how long the program has been running at each stage.  I don't know how long your scream audio is, so adjustments will be necessary.

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


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


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


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

SYMBOL  Audio           = PIN7                  ' SETUP = DN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN, NO = R + W
SYMBOL  Motor           = PIN5
SYMBOL  Blaster         = PIN4
SYMBOL  UL_Light        = PIN3                  ' upper left light
SYMBOL  UR_Light        = PIN2                  ' upper right
SYMBOL  LR_Light        = PIN1                  ' lower right
SYMBOL  LL_Light        = PIN0                  ' lower left


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

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  TrOn            = 1                     ' active-high trigger
SYMBOL  TrOff           = 0

SYMBOL  IsOn            = 1                     ' active-high I/O
SYMBOL  IsOff           = 0


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

SYMBOL  timer           = B2                    ' for debounce loop
SYMBOL  idx             = B3

SYMBOL  delay           = W5


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

Power_Up:
  ' put code here that only happens at power-up/hard reset

Reset:
  PINS = %00000000                              ' all off
  DIRS = %10111111                              ' P7, P5..P0 are outputs


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

Main:
  timer = 0                                     ' reset debounce timer

Check_Trigger:
  PAUSE 5                                       ' scan delay
  IF Trigger = TrOff THEN Main                  ' check trigger input
    timer = timer + 5                           ' update timer
  IF timer < 100 THEN Check_Trigger             ' check timer


  ' Time = 0.00

  Motor = IsOn                                  ' start motor

  Audio = IsOn                                  ' start audio player
  PAUSE 250
  Audio = IsOff

  ' Time = 0.25

  PAUSE 500                                     ' adjust for audio

  ' Time = 0.75

ZZ_Lights:
  FOR idx = 0 TO 4                              ' loop through table
    LOOKUP idx, (2000, 1500, 1000, 750, 500), delay

  IF delay <> 500 THEN Zig_Zag
    Blaster = IsOn

Zig_Zag:
    UL_Light = IsOn
    PAUSE delay
    UL_Light = IsOff

    UR_Light = IsOn
    PAUSE delay
    UR_Light = IsOff

    LL_Light = IsOn
    PAUSE delay
    UL_Light = IsOff

    LR_Light = IsOn
    PAUSE delay
    LR_Light = IsOff

    Blaster = IsOff
  NEXT

  ' Time = 23.75

CrissCross:
  delay = 500
  FOR idx = 1 TO 5
    UL_Light = IsOn
    LR_Light = IsOn
    PAUSE delay
    PINS = PINS & %11110000                             ' all lights off
    LL_Light = IsOn
    UR_Light = IsOn
    PAUSE delay
    PINS = PINS & %11110000
  NEXT

  ' Time = 28.75

  PINS = IsOff                                          ' everything off
  PAUSE 30000                                           ' hold 30s

  GOTO Main                                             ' start again


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


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


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

sinstar

I'm having trouble hooking up the cap-200 cowlacious board to the prop-1 controller. What line do I need to hook up to get it to trigger in dm (dual-message mode)?  The motion sensor works if it's hooked up directly to the cowlacious - but I can not get it to trigger when I try to hook it up to the prop-1.

JonnyMac

You'll need to talk with Carl about that; we don't have his boards to test with.  I know in the past that people have used them using the simple pulse output in the code above, but not having a unit to work with I cannot give you anymore.  Carl's a good guy, and can help you get things rolling with his product.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

The easiest way to trigger the audio is to use the V-Trig connection. Set the jumper for the voltage you are powering the Prop-1 with. Connect one of the V-Trig pins on the CAP200 to V+ on the Prop-1 and the other V-Trig pin to OUT7 on the Prop-1. By the description of your prop you'll probably want the CAP200 in regular mode, not DM.

sinstar

ok guys - here's the update - we had it hooked up and couldn't get the sound to trigger.  We decided there must be something wrong with the prop-1 board - so we pulled out a new one and noticed that the chip in the non-working board is shorter than all of the other chips.  It's missing a set of legs (only eight - instead of nine) for your info the numbers on the chips are as follows
short chip - does not say toshiba uln-2003ag
long chips all say Toshiba uln-2803ag - once we connected to the longer chip - Fixed!
Thanks for your help

JonnyMac

Nothing wrong with the board, it just had a ULN2003 in place of the ULN2803 -- this board was probably using P7 for serial comms before.  The ULN interferes with serial data, hence we change to ULN2003, or in a pinch, clip off pin 1 of the ULN2803.
Jon McPhalen
EFX-TEK Hollywood Office