May 01, 2024, 04:37:13 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.


How to trigger hacked DVD play with Prop-2 output

Started by Spooky Dad, September 06, 2014, 02:01:09 PM

Previous topic - Next topic

Spooky Dad

Using the prop-2, I have a very simple program (below) that is using a motion that, when it senses a victim,  will cause a Normally Open (NO) output P0 to short, thus triggering a hacked DVD player to run the Atmosfear.fx Ghost DVD.  When I trip the DVD player manually, the ghost activates.  When I hook up the output to P0 and GND, I can't get the program to trip the hacked DVD.

From what I read in the documentation, the outputs on the Prop-2 float high when not active and get pulled to ground when active, but using a ohm meter (between P0 and GND), I can not see the circuit ever pulling to ground. 

Motion is Pin14
Ouput is P0 and is connected to one side of DVD trigger
GND is connected to the other side of hacked DVD trigger

' =========================================================================
'
'   File......  Portrait Gallery G2e.bs2
'   Purpose...
'   Author....  Karlen S. Alexander
'   E-mail....  kalexander@secureworks.com
'   Started...
'   Updated...
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================


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


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


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

Motion1         PIN     14                      ' (I) SETUP = DN


Man_Vid         PIN      0                      ' (O)


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

IS_ON           CON     1                       ' for active-high in/out
IS_OFF          CON     0

TR_ON           CON     1
TR_OFF          CON     0

'YES             CON     1
'NO              CON     0

'AUDIO_PLAYING   CON     0                       ' play = OC output


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

timer           VAR     Byte                    ' for debouncing
'asPin           VAR     Byte                    ' audio start pin


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

Reset:
  OUTH = %00000000 : OUTL = %00000000           ' clear all
  DIRH = %00111111 : DIRL = %11111111           ' set outputs
  PAUSE 20000                                   ' let motions settle

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

DEBUG CLS, "Skeleton G2E Controller", CR,"-- program (re)started", CR, CR, LF

Main:

'Motion 1 Control and effects
  timer = 0
  DO WHILE (timer < 20)                        ' debounce = 100ms
    DEBUG "Stuck in Trigger Mode and Timer is ", DEC timer, CR, CR, LF
    PAUSE 5
    IF (Motion1 = TR_ON) THEN
      DEBUG "Motion 1 is Not High", DEC timer, CR, CR, LF
      timer = 0
    ELSE
      DEBUG "MOTION 1 IS HIGH HIGH HIGH", DEC timer, CR, CR, LF
      timer = timer + 50
    ENDIF
    PAUSE 5
  LOOP

Man_Vid = Is_On
PAUSE 500
Man_Vid = Is_Off


OUTH = %00000000 : OUTL = %00000000


GOTO Main

JonnyMac

You need to know -- with certainty -- the type of input required; an incorrect connection could damage one or both sides.

QuoteFrom what I read in the documentation, the outputs on the Prop-2 float high <snip>

You've misunderstood something; a floating output is neither high nor low unless affected by a pull-up or pull-down. Pins that are connected to the input circuitry of the ULN will be pulled down (this is why we clip pins in some cases).

If the circuit you're connecting to is uses ground to trigger, it's best to try the ULN outputs first, as they switch from floating (when off) to ground.

Note: It is always a bad idea to put DEBUG statements in the middle of timed loops (e.g., waiting for trigger) as these statements foul the timing.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

QuoteFrom what I read in the documentation, the outputs on the Prop-2 float high when not active and get pulled to ground when active, but using a ohm meter (between P0 and GND), I can not see the circuit ever pulling to ground. 

P0.W is gonna be high when active (TTL). Does touching to two DVD trigger leads together start the video? If so, you will probably need a small relay with a set of N.O. contacts. If this is the case, use V+ and OUT0 to energize the relay.

bsnut

Jack makes a good point to use a relay to trigger the audio board. The reason is that you won't be able to damage the Prop-2. Just think relays as small expense for a little added protection that can't damage the audio board or the Prop-2.
William Stefan
The Basic Stamp Nut

Spooky Dad

Thanks Jonny. No always take debug statements out when I get the program working the way I want.

I will add in a relay to trip the dry trigger.