November 24, 2024, 11:05:10 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.


AP-16 and the Prop-1 Controller

Started by joecuellar3, September 16, 2013, 01:32:49 PM

Previous topic - Next topic

joecuellar3

Hello
Trying the prop1 controller again this year, but just can't wrap my head around it! I'm trying something simpler, so if you could help me out I would appreciate it. I have the AP-16 to use plus the PIR sensor and a Precision Z - High Power Floodlight from dark light.
So here is the scenario:
1.)   sfx01 plays on a continuously loop, but will drop out. Could I use the ambient switch?
2.)   The PIR sensor is waiting for it's movement
3.)   Once movement is detected there is a 3 second delay
4.)   sfx01 drops out and sfx02 plays
5.)   Simultaneously a One Precision Z - High Power Floodlight from dark light begins to strobe. (I'm not sure if there is a program to make the floodlight strobe?) Also will the Prop-1 power the
        light? It's  12v, 1.2w, & 120mA
6.)   4 & 5 will occur for ten seconds
7.)   A stop delay of ten seconds occurs to have time to reset.
8.)   Program stop and starts from the beginning with the sfx01 playing and sensor waiting for a signal

I hope you can help! I've got the two sound tracks sfx01 and sfx02 playing on the AP-16 now which was a challenge. Who knew meta tags could interfere with a play back!
Thanks Joe

JonnyMac

QuoteWho knew meta tags could interfere with a play back!

We've been warning customers since the AP-16+ came out! Audacity is your friend.


Your program is easy -- I could write it and eat lunch at the same time (and I did!).

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


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


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


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

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

SYMBOL  Strobe          = PIN0                  ' use V+/OUT0


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

SYMBOL  YES             = 1
SYMBOL  NO              = 0

SYMBOL  TR_ON           = 1                     ' active-high trigger
SYMBOL  TR_OFF          = 0

SYMBOL  IS_ON           = 1                     ' active-high I/O
SYMBOL  IS_OFF          = 0

SYMBOL  BAUD            = OT2400


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

SYMBOL  timer           = W5                    ' for debounce loop


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

Power_Up:
  PAUSE 3000                                    ' let AP-16+ power up

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

  SEROUT Sio, BAUD, ("!AP16", %00, "PS", 1, 0)  ' SFX01 in loop mode

  PAUSE 10000                                   ' PIR warm-up/delay


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

Main:
  timer = 0                                     ' reset debounce timer

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

  SEROUT Sio, BAUD, ("!AP16", %00, "PS", 2, 1)  ' SFX02 1x

  timer = 10000                                 ' run 10 seconds

Strobe_Loop:
  Strobe = IS_ON
  PAUSE 100
  Strobe = IS_OFF
  PAUSE 100
  timer = timer - 200
  IF timer > 0 THEN Strobe_Loop

  GOTO Reset


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


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


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

JonnyMac

Just a note: The program, as written, pulses the strobe at a fixed rate. If you would prefer it to flash randomly, I can update the program to do that.
Jon McPhalen
EFX-TEK Hollywood Office

joecuellar3

Hey JonnyMac
Thank you for such a speedy response! I will go home tonight and give it a try. Thanks again! By hooking up the light to V+/OUT0 will that give it power?

JackMan

With the Prop1 switch in position 2, the V+ terminal block is postive voltage (equal to the power supply you have connected to the Prop1, usually 12VDC). The OUT terminals are GND when active.

JonnyMac

September 18, 2013, 01:33:01 PM #5 Last Edit: September 18, 2013, 02:09:14 PM by JonnyMac
If your light is in fact drawing 120mA as you specify, you can control it directly from the Prop-1. As Jack points out, connect the positive side of your light to V+, the negative side to OUT0. Makes sure the power switch is in P2 for operation.
Jon McPhalen
EFX-TEK Hollywood Office

joecuellar3

Hey JonnyMac
Every thing seem to be working spot on!! Thank you so much! I have a couple of questions, where do I change the duration of sfx2 and the strobe to go either longer or shorter? Secondly can there be a delay when the senor is triggered? It seams that as soon as the sensor is trigger it switches, I would prefer a delay there that i could control if it's possible. Thanks again.

JonnyMac

Adding a delay is easy: simply add a PAUSE statement after the trigger and before the SEROUT that plays the audio. Remember that PAUSE uses milliseconds, so PAUSE 1000 will give you a one-second delay.

To shorten the audio you'll need to open the file in an editor like Audacity.

To change the strobe timing (to match the new length of the audio), you need to change the line that assigns the timer. At the moment it is set to 10000 (for 10 seconds).
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

This is what Jon is talking about by adding the PAUSE and changing the 10000 in this line which will change how long the strobe light will be on.
PAUSE 1000

timer = 10000                                 ' run 10 seconds

You will also need to change the length of the sound file to match the show as well.

William Stefan
The Basic Stamp Nut