November 21, 2024, 04:15:52 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.


Spider Room

Started by p8balls, October 02, 2016, 07:15:45 PM

Previous topic - Next topic

p8balls

October 02, 2016, 07:15:45 PM Last Edit: October 05, 2016, 05:47:47 PM by p8balls
Hey Guy's,
It's been a long time since I've done prop building (2006-2007) and we're attempting a haunt this year using some of my old props and creating some new. It's been so long using the Prop1 that there are a lot new products available. I still have a few Prop1's and a half a dozen sensors and also a few uMP3 players, I thought I had an RC-4 but I don't and it looks like that may have been replaced with something different.

I am wondering/hoping that I can get code for the following scene and a list of products needed so I can get everything ordered right away.

We're building a spider room similar to the attached video link: http://vid43.photobucket.com/albums/e375/Brckee1/Giant%20Spider%20Mechanism/spiderroomvid.mp4l


So here's what I want to happen:

Scene ready:
Music Track 1 Playing (uMP3 Player)
Spider Home (12v Solenoid)
String Drop Up (12v Solenoid)
Ceiling Closed (12v Solenoid)
Ankle Ticklers Off (12v Solenoid)
Room Light On (110v)
Strobe Light Off (110v)

Scene Triggered:
Music Track 2 Playing
Strobe On
Room Lights Off
Spider Jumps (On 1sec /Off .5sec /On) This will leap to the patron then give a quick jump. May need to tweak the timing.
All lights off .5sec after
(Spider can Home)
Ceiling Open
Music Track 3 Playing
.5sec String Drop Down (On/Off 3x)
Ankle Ticklers On
String Drop Up
Ceiling Colsed (All happens in approx 15sec)
Ankle Ticklers Off
Back to scene Reset
Delay sensor 15-20 seconds to allow room to empty

When I get this room finished I will be sure to post the video. Thank you in advance for the help.
Chris

p8balls

OK so here is my attempt to code the scene above and would like a little feedback to see if I am close and where there are any issues.

I hacked the code apart from 2 of my props that Jon did for me back in 2006, 1 uses a uMP3 and the other uses an RC-4 and this project uses both. I see that the RC-4 is no longer available and there are a couple other options with 2 relays which would work fine since I am only running 2 110v items. I'm not familiar with the new products so please recommend what would work best and I'm sure the code will need to be revised from the RC-4 to the new board.

Also I can't test it because my USB to Serial cable is rusted on the USB end so I will be ordering new cables with the additional items I need which I would like to order as soon as I know what I need.
Thanks for the help!



' =========================================================================
'
'   File...... Spider Room
'   Purpose...
'   Author.... Chris O'Dell
'   E-mail.... chris@logoprintco.com
'   Started...
'   Updated... 4 OCT 2016
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  sio             = PIN7                  ' remove SETUP, ULN pin
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  TX              = 5                     ' to UMP3.R
SYMBOL  RX              = 4                     ' to UMP3.T
SYMBOL  Ticklers        = PIN3
SYMBOL  StringDrop      = PIN2
SYMBOL  Ceiling         = PIN1
SYMBOL  Spider          = PIN0


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

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


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

SYMBOL  relays          = B0                   
SYMBOL  temp            = B2                    ' general purpose var
SYMBOL  pirCount        = B3                    ' for PIR input debounce
SYMBOL  ltroom          = BIT0
SYMBOL  strobe          = BIT1
SYMBOL  sfx             = B2                    ' SOUND fx file on uMP3


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

Startup:
  PAUSE 2000                                    ' let uMP3 start

Prod_uMP3:
  SEROUT TX, OT2400, (13)                       ' send CR
  SERIN  RX, OT2400, temp                       ' get response
  IF temp <> ">" THEN Prod_uMP3                 ' wait for ">"

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00001111                              ' make P0-P5 outputs
  relays = %0001                                ' start with room light
  GOSUB Set_Relays                              ' set RC-4 relays


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

Main:
pirCount = 0                                  ' clear for PIR count

Wait_Trigger:
  PAUSE 25

  GOSUB Stop_MP3_Looping
  sfx = 1                                     ' spider scream
  GOSUB Play_MP3

  strobe = IsOn
  ltroom = IsOff
  GOSUB Set_Relays

  Spider = IsOn
  PAUSE 1000
  Spider = IsOff
  PAUSE 300
  Spider = IsOn
  PAUSE 500

  strobe = IsOff
  Ceiling = IsOn

  sfx = 2                                     'spider attack
  GOSUB Play_MP3
  PAUSE 500

  StringDrop = IsOn                           ' all timing will be adjusted for best performance
  Ticklers = IsOn
  PAUSE 1000
  StringDrop = IsOff
  PAUSE 500
  StringDrop = IsOn
  PAUSE 500
  StringDrop = IsOff
  PAUSE 300
  StringDrop = IsOn
  PAUSE 500
  StringDrop = IsOff
  PAUSE 500

  Ceiling = IsOff
  Ticklers = IsOff

  Show_Delay:
  GOSUB Play_Background
  ltroom = IsOn
  ' PAUSE 25000

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------
Play_Background:

  GOSUB Set_MP3_Looping
  sfx = 0                                       ' Creepy Music

  ' no RETURN; falls through to Play_MP3

  Set_Relays:
  SEROUT Sio, OT2400, ("!RC4", %00, "S", relays)
  RETURN

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

  ' Plays a file from the Rogue uMP3 player
  ' -- MP3 files in root and named SFX0.MP3, SFX1.MP3, etc.
  ' -- pass the file in "sfx", 0 to 9
  ' -- command stops any audio in progress

Play_MP3:
    IF sfx > 9 THEN Play_MP3_Exit                 ' skip if invalid
     sfx = sfx + "0"                             ' convert to ASCII char

     ' start sound on uMP3
     SEROUT TX, OT2400, ("PC F /SFX", sfx, ".MP3", 13)
     sfx = sfx - "0"

Play_MP3_Exit:
    RETURN

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

  ' Returns "P" if playing, "S" if stopped

Get_uMP3_Status:
   SEROUT TX, OT2400, ("PC Z", 13)
   SERIN  RX, OT2400, temp
   RETURN

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

Set_MP3_Looping:
   temp = "0"                                    ' loop forever
   GOTO MP3_Loop_Cmd

Stop_MP3_Looping:
    temp = "1"                                    ' play file once

MP3_Loop_Cmd:
   SEROUT TX, OT2400, ("PC O ", temp, 13)        ' set looping command
   PAUSE 25                                      ' let command "stick"
   RETURN

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

p8balls

I placed an order today for a bunch of items for this and a few other props I need to put together by the 14th but for this project I ordered a RC-2 Relay Board. The only issue is I didn't see any documentation on these in the forum and assume the code is different from the RC-4 code above. If anyone has experience with these I'd appreciate some help.  ;)
Thanks,
Chris

JonnyMac

The Amigo boards are plug-and-play. You connect a wire extender from your Prop-1 to the input of the Amigo and Bob is your uncle.

BTW... the RC-2 documentation is on the main web site product page. Here's a direct link.
-- http://www.efx-tek.com/downloads/rc-2_docs.pdf
Jon McPhalen
EFX-TEK Hollywood Office

p8balls

Hey Jon,
Thanks for chiming in!

I see now. So each relay is triggered from an individual input instead of a serial connection like the RC-4 so all I have to do is define the room light and strobe then trigger those on a PIN like everything else. Sounds easy except I had 1 input available for the relays and the rest are full. I could use the DC-16 I have for extra inputs or actually I'll just remove the ticklers input from the code and just trigger them when the ceiling activates.


Here is the modified code, let me know if I'm on the right path.


' =========================================================================
'
'   File...... Spider Room_rev2
'   Purpose...
'   Author.... Chris O'Dell
'   E-mail.... chris@logoprintco.com
'   Started...
'   Updated... 5 OCT 2016
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  ltroom          = PIN7                  ' remove SETUP, ULN pin
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  TX              = 5                     ' to UMP3.R
SYMBOL  RX              = 4                     ' to UMP3.T
SYMBOL  strobe          = PIN3
SYMBOL  StringDrop      = PIN2
SYMBOL  Ceiling         = PIN1
SYMBOL  Spider          = PIN0


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

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


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

SYMBOL  temp            = B2                    ' general purpose var
SYMBOL  pirCount        = B3                    ' for PIR input debounce
SYMBOL  sfx             = B2                    ' SOUND fx file on uMP3


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

Startup:
  PAUSE 2000                                    ' let uMP3 start

Prod_uMP3:
  SEROUT TX, OT2400, (13)                       ' send CR
  SERIN  RX, OT2400, temp                       ' get response
  IF temp <> ">" THEN Prod_uMP3                 ' wait for ">"

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

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

Main:
  pirCount = 0                                ' clear for PIR count
  ltroom = IsOn

Wait_Trigger:
  PAUSE 25

  GOSUB Stop_MP3_Looping
  sfx = 1                                     ' spider scream
  GOSUB Play_MP3

  strobe = IsOn
  ltroom = IsOff

  Spider = IsOn
  PAUSE 1000
  Spider = IsOff
  PAUSE 300
  Spider = IsOn
  PAUSE 500

  strobe = IsOff
  Ceiling = IsOn

  sfx = 2                                     'spider attack
  GOSUB Play_MP3
  PAUSE 500

  StringDrop = IsOn                           ' all timing will be adjusted for best performance
  PAUSE 1000
  StringDrop = IsOff
  PAUSE 500
  StringDrop = IsOn
  PAUSE 500
  StringDrop = IsOff
  PAUSE 300
  StringDrop = IsOn
  PAUSE 500
  StringDrop = IsOff
  PAUSE 500

  Ceiling = IsOff

  Show_Delay:
  GOSUB Play_Background
  ltroom = IsOn
  PAUSE 25000

  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------
Play_Background:

  GOSUB Set_MP3_Looping
  sfx = 0                                       ' Creepy Music

  ' no RETURN; falls through to Play_MP3

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

  ' Plays a file from the Rogue uMP3 player
  ' -- MP3 files in root and named SFX0.MP3, SFX1.MP3, etc.
  ' -- pass the file in "sfx", 0 to 9
  ' -- command stops any audio in progress

Play_MP3:
    IF sfx > 9 THEN Play_MP3_Exit                 ' skip if invalid
     sfx = sfx + "0"                             ' convert to ASCII char

     ' start sound on uMP3
     SEROUT TX, OT2400, ("PC F /SFX", sfx, ".MP3", 13)
     sfx = sfx - "0"

Play_MP3_Exit:
    RETURN

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

  ' Returns "P" if playing, "S" if stopped

Get_uMP3_Status:
   SEROUT TX, OT2400, ("PC Z", 13)
   SERIN  RX, OT2400, temp
   RETURN

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

Set_MP3_Looping:
   temp = "0"                                    ' loop forever
   GOTO MP3_Loop_Cmd

Stop_MP3_Looping:
    temp = "1"                                    ' play file once

MP3_Loop_Cmd:
   SEROUT TX, OT2400, ("PC O ", temp, 13)        ' set looping command
   PAUSE 25                                      ' let command "stick"
   RETURN

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

p8balls


p8balls

Hey John,
We received our items today so I'm going to start testing the code. I've noticed some changes to the Prop-1 from the early Rev C boards I currently have. (did I mention it's been a while)

I noticed the ULN chip is no longer socketed and there looks to be +/- solder points near the power switch (for pigtail??)

Previously for the uMp3 we would pull the chip and clip the pins to get it to function correctly. How do we do that on the current version of the prop-1??

In this thread it looks like you are using P7, P6, and P5 with no ULN.
http://www.efx-tek.com/php/smf/index.php?topic=1251.0

Do we cut the traces now or is there another work around?? I couldn't find updated documentation regarding the new chip and +/-. The other issue is with the Prop-1 trainer we're supposed to remove the chip.

Please let me know how to go about doing this and provide feedback on the code above.
Thanks,
Chris

JonnyMac

Give me a day -- I will document how to update the new boards. JB handles production and I had forgotten all about that.
Jon McPhalen
EFX-TEK Hollywood Office