November 23, 2024, 02:24:04 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.


Monster out of a building

Started by roybbadd, October 27, 2009, 04:56:45 PM

Previous topic - Next topic

roybbadd

I have a efx-tek starter kit with the passive infrered sensor, i also have a 110 solinoid and a 2 port air ram and a cowlacious isd 17xxx recorder player board, i need help with writing the program to make the player play for 30 seconds , and at the last 15 seconds the program to lift the prop for 5 seconds and then lower the prop and reset the prop with a 15 second delay.

JonnyMac

I'm a little confused... please, help me by spelling out how you want your program to operate -- like this:

1) Wait for PIR
2) Start audio player
3) Wait XX seconds
4) Pop-up monster
5) Hold for YY seconds
6) Hide monster
7) Wait ZZ seconds (audio finish + retrigger delay_
8) Back to #1

Also, the Prop-1 can only start Cowlacious audio player, it cannot stop it.  What you'll need to do is record the audio you need and the control will be time-based on that.  Audacity is a great tool for analyzing an audio file to get precise timing.
Jon McPhalen
EFX-TEK Hollywood Office

roybbadd

1) wait for pir
2) start audio player
3) wait 10 seconds
4) pop-up monster
5) hold for 5 seconds
6) hide monster
7) wait 10 seconds (audio finish + retrigger delay)
8) back to #1


JonnyMac

October 28, 2009, 01:13:25 PM #3 Last Edit: October 28, 2009, 01:15:22 PM by JonnyMac
Here you go!

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


' -----[ Program Description ]---------------------------------------------
'
' Trigger :: Parallax-compatible PIR or N.O. button (mat switch, etc.)
'            -- connect N.O. button between P6.W and P6.R


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


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

SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  CARP            = PIN5                  ' V+/OUT5 to V-Trig @9-12v
SYMBOL  Monster         = PIN0                  ' V+/OUT0 to relay


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

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

SYMBOL  IsUp            = 1
SYMBOL  IsDown          = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  timer           = B2


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

Reset:
 PINS = %00000000                              ' clear all
 DIRS = %00111111                              ' set output pins

 PAUSE 10000                                   ' inter-show delay


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

Main:
 timer = 0                                     ' reset timer

Check_Trigger:
 PAUSE 5                                       ' loop pad
 timer = timer + 5 * Trigger                   ' update timer
 IF timer < 100 THEN Check_Trigger             ' wait for 0.1 sec input

Start_Audio:
 CARP = IsOn
 PAUSE 100
 CARP = IsOff

 PAUSE 10000

Pop_Up:
 Monster = IsUp
 PAUSE 5000
 Monster = IsDown

 GOTO Reset


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


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


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

roybbadd

I followed the the instructions on the support form and I got the hello world to come up in the debug terminal, then I copy and paste the program that was wrote for me but I did not get a debug terminal when I down loaded the program, is that suppose to happen, thanks

livinlowe

Jon's program does not show a debug screen. That is normal.
Shawn
Scaring someone with a prop you built -- priceless!

BigRez

The only time a debug window appears after downloading is when the code contains a DEBUG line.

roybbadd

thank you for everything, i will test today and make it work

roybbadd

OK i got it programed and i have three questions,
1) i have a black and white wire coming from the carp, does this mean that i hook the white wire to the out5 and the black wire to ground?
2) on the outo to relay i have a white wire and a black wire that come off of the resistor, does this mean the white wire will go to the out0 and the black to ground?
3) the trigger, i am lost on hooking that up, does this black, red, white , go to p6 in the row of p0 thru p7 or do i remove the black jumper and put it on the set up dn
this is my first time hooking this all up and i just want to make sure the first time so i dont mess it up, thank you for your help

JonnyMac

October 30, 2009, 09:52:46 AM #9 Last Edit: October 30, 2009, 10:23:57 AM by JonnyMac
Ever hear the phrase: Had it been a snake it would have bit you?  Between our documentation (which I'm betting you haven't downloaded and read... right?) and the program listing, all the answers are in your hand.

1) It's right in the program -- look at this line:

SYMBOL  CARP            = PIN5                  ' V+/OUT5 to V-Trig @9-12v

See?...  it explicitly says V+ and OUT5.  When you read the CAR/P docs (hint, hint) you'll find that the V-Trig input is not polarized so the colors don't matter, but as a matter of convention I would connect the white to V+ and black to OUT5; the OUTx terminals switch ground so this makes sense to me.


2) Deja vu.  And, to top it off, the Prop-1 instructions...

http://www.efx-tek.com/downloads/prop-1_docs.pdf

...show that relays and valves are always connect to V+ and the OUTx terminals.  And, again, I put it right in your code listing.

SYMBOL  Monster         = PIN0                  ' V+/OUT0 to relay


3) We also have PIR docs...

http://www.efx-tek.com/downloads/pir_docs.pdf

...that show how to connect and use the PIR.  The white wire connects to OUT on the PIR and the P6.W pin, red goes to the P6.R pin, black goes to the P6.B.  Have a look at the board, above the headers you'll see W R B which tells you what color goes where.  Also, make usre the SETUP jumper is in the DN position, Just as the program listing tells you.

SYMBOL  Trigger         = PIN6                  ' SETUP = DN

Note: the program doesn't care what kind of trigger you're using -- could be a PIR, could be a mat switch; the signal looks the same to the Prop-1.


Please, it's exhausting to have to cover the same ground over and over and over again -- we provide docs for a reason, and these forums to go above and beyond those for specific applications.  Download and read the docs (the CAR/P docs, too!) before you get back to your prop -- you'll have better luck.

Happy Halloween!
Jon McPhalen
EFX-TEK Hollywood Office