November 23, 2024, 11:52:06 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.


Movie Magic Random Lights on a board @24vDC

Started by TheHauntStore, September 04, 2011, 02:05:22 AM

Previous topic - Next topic

TheHauntStore

Hi All,
A bit of help building some code for a flashy tricked up panel of lights like they do in the movies, but not exactly like in the movies.
So I picked up a bunch of old panels from my favorite place in North Hollywood called Norton Sales owned by Carlos (great guy).

the Simple Part:
With these panels I would like to use a Prop-1 and it's 8 channels to randomly blink the 24vDC lights on the panel from the powered rail. (is there something I can look up to see if I need a power supply bigger than the standard 24vDC/1.2amp?)

Now the tough part:
I would like each animated light cycle (8 Channels) to be randomized from the previous cycle so there is no apparent pattern (ever if possible), in addition not just one channel lite turning on but  multiple channels at various random times.
(also a place in the code where I can mod the blink rate in case I need to make it faster or slower)

Now the Cool part:
With a dry switch or PIR activation I want all of the lights to go haywire frizzy like I won huge at the penny slots in Vegas. For about 10-15 seconds(also a place in the code where I can mod the time in case I need to make it longer or shorter) then when that time is up it goes back to the normal animated light cycle.

Not so hard part!
Having multiple Prop-1's triggered at the same time to go Bizzerkiod! for the multiple panels.
Figure I just string them all up to a dry contact or to one PIR(maybe the PIR is a lil tricky?)

Can that be achieve in Prop-1 code (which would be beyond my programming skills) or do I need to mix and match some boards to achieve what I am thinking which is a randomize blinker with a lottery to choose which lights to blink with multiple one's on at times, and a frenzy of lights.

Hope that not asking to much from a prop-1. to me Prop-1's are work horses and have yet to not do something.

(fingers crossed)
I think this is a lot to ask of the prop-1 but it hasn't let me down yet!
C'mon not snake eyes...

JAy
The Haunt Store(TM)
"Free Screams With Every Order, Upon Request"

JackMan

As Jon would say, this is like asking a go-cart to win the Indy 500. I don't think this is possible with a Prop-1 but I'm sure Jon will steer you in the right direction.

JonnyMac

You can do this, but with some restrictions:

1) You can only have 7 outputs per Prop-1 as you need one pin to serve as the "go crazy" trigger
2) Do not use this code with a PIR; the code structure does not allow for debouncing the PIR
3) You should use a voltage input into the Prop-1 as a trigger.  You can use your 24v source for this but you will have to
    put a 50-100K resistor in series with the Px.W input pin (on each board). You will also need to have ground common
    between all controllers.

Here's a little test version that you can try on the Prop-1 Trainer.  In the production code you would move Trigger to PIN7 so that you have seven outputs.  You will also need to change the lottery = 1031 line in each controller, otherwise, if they power up at the same time they will all be in sync.

' =========================================================================
'
'   File...... hs_blinker.bs1
'   Purpose...
'   Author.... Jon "JonnyMac" Williams, EFX-TEK
'   E-mail....
'   Started...
'   Updated... 04 SEP 2011
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Trigger         = PIN6                  ' SETUP = DN


' -----[ 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  delay           = W3
SYMBOL  lottery         = W4
SYMBOL  timer           = W5


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

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

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00111111                              ' P5..P0 are outputs

  lottery = 1031                                ' different for each Prop-1


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

Main:
  BRANCH Trigger, (Slow_Run, Fast_Run)


Slow_Run:
  GOSUB Randomize                               ' randomize
  PINS = lottery                                ' output
  delay = lottery // 151 + 100                  ' 100 to 250ms (slow)
  PAUSE delay                                   ' hold
  GOTO Main


Fast_Run:
  timer = 15000                                 ' run for 15 seconds

FR_Loop:
  GOSUB Randomize                               ' randomize bits
  PINS = lottery                                ' output
  delay = lottery // 26 + 25                    ' 25 to 50ms (fast)
  PAUSE delay                                   ' hold
  IF timer < delay THEN Main                    ' done?
    timer = timer - delay                       '  no, update timer
    GOTO FR_Loop


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

' RANDOM is called 3x to hide motion of LFSR algorithm when outputs are
' placed in linear fashion

Randomize:
  RANDOM lottery
  RANDOM lottery
  RANDOM lottery
  RETURN


' -----[ User Data ]-------------------------------------------------------

Jon McPhalen
EFX-TEK Hollywood Office

bsnut

September 04, 2011, 07:34:13 PM #3 Last Edit: September 06, 2011, 01:24:03 AM by bsnut
As you can see this is another cool coding trick that Jon did

BRANCH Trigger, (Slow_Run, Fast_Run)


What is happening here is when Trigger isn't pushed "0" it will go to label "Slow_Run" and when Trigger is pushed it will go to label "Fast_Run".

You are wondering why he did this. The BRANCH command saves you form typing all this below with one command.

Main:
  IF Trigger = 1 THEN Fast_Run

Edit: Corrected to reflect Jon's post.
William Stefan
The Basic Stamp Nut

JonnyMac

Actually, in this program you would only need one IF-THEN statement -- but you're right, BRANCH with one or two target labels is still faster than IF-THEN.
Jon McPhalen
EFX-TEK Hollywood Office

TheHauntStore

OMG this totally rocks!
I can't believe the simplicity of the programming for this.
here I was thinking.. oh my this is gonna be a page or two of coding!

Jon thank you for this. Our Space haunt this year has just stepped up to Movie Magic level.

Thanks,
-JAy
The Haunt Store(TM)
"Free Screams With Every Order, Upon Request"

JonnyMac

Good to hear, Jay.  I'll pop by for a visit.
Jon McPhalen
EFX-TEK Hollywood Office

TheHauntStore

Great we will be working all weekend.
We are Building a Teleportation room which could use alot of EFX-TEK Tech Tools!

Please let me know if you have any of those "Special" eye items you showed at MWH in Ohio.
I would like to test it out.

JAy--
http://www.thehauntstore.com
"we make nightmares a reality"
ThemeParks using our stuff:
Kennywood Park
Disneyland
Sea World USA
FrontierLand

Haunts using our stuff:
Old Town Haunt
Winchester Mystery House
SinisterPoint
Haunted Fresno
FrightDome

Rotten Apple 907 2011 Haunt Presents
907: A Space Oddacity
Beyond Frontier Earth space resort
(...when Egypt isn't far enough)
Teleport Passes now being issued to the
Interstellar B.F.E. Space Resort
Limited Departures in October 2011: 22nd-23rd, 29th Thru 31st
http://www.rottenapple907.com
The Haunt Store(TM)
"Free Screams With Every Order, Upon Request"