November 23, 2024, 03:50:45 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.


EZ-8 Controlling Prop-1's

Started by Dark Shadows, July 21, 2010, 09:02:59 PM

Previous topic - Next topic

Dark Shadows

I'm going to be doing a display more like a show and having an EZ8 on repeat and just cycling through switching on the prop-1's I already have (instead of PIRS). I'm going to be using 5 prop-1s, and the other outputs on the EZ8 are going to have solenoids hooked up (since its a simple on off instead of multi-output sequence). I bought an EZ-8 and some 12" servo connectors.. I talked to one of you guys there at the show about what I'm doing, and I want the EZ-8 to trigger each prop-1 via the TTL connections. My question is, how do I write the code for the trigger on my prop-1? From my understanding (Im still new at this stuff, give me a break!) I need to download a new program onto each prop-1 to have an input code from the Ez8 ttl connection instead of the pir code?

What I want each prop-1 to do..

Wait untill triggered from the EZ8 via servo cable.
Activate solenoid
Keep Prop activated for 6 seconds
cut off power to the solenoid
wait until retriggered from the ez 8.

I'm pretty much looking for a template to work off of as far coding the trigger input thru the ttl servo cable instead of the pir code... Any help would be appreciated! Thanks

Mike
Dark Shadows

JonnyMac

The great news is that our standard programming template will do the trick.  You see, the Prop-1 doesn't know what the input device is, and doesn't care if it's a PIR, a push-button, or the signal from another processor -- as long as the signal is active-high.

The only thing you have to do is make sure the pulses from your EZ-8 are at least 1/10th of a second, and you do not want them to go longer than the duration of the prop code that you're triggering.

' =========================================================================
'
'   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  Solenoid        = PIN0


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

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


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all pins
  DIRS = %00000001                              ' make P0/OUT0 an output


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

Main:
  timer = 0                                     ' reset debounce 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

  Solenoid = IsOn
  PAUSE 6000
  Solenoid = IsOff

  GOTO Main


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


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


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

Dark Shadows

July 22, 2010, 09:23:25 AM #2 Last Edit: July 22, 2010, 09:40:19 AM by Dark Shadows
Thanks! The perfect respone I was looking for. So I actually dont have to reprogram each prop-1 that I'm already using with a PIR, just connect the servo cable from the EZ-8 to the PIN6 Trigger input (Or which ever I have it programmed for the input already)? I was under the assumption that I had to write a different code for the different trigger device.. Gues not! Thanks! Going to test it today!

Dark Shadows

So hooked up the prop-1s... Tested the program with a PIR plugged into PIN 6. Now, If I connect the 3 cable wire from the PIN 6 to the CHANNEL 1 prongs on the EZ 8, it gets power. I had all of the Prop-1's hooked up with the 3 wire cables and they all turned on, with me applyign power to the first prop-1!! Did I wire something up wrong or is this normal?? Maybe wire up relays to the EZ8 channels and only use the red/white cables as the switching on the prop-1s? Im lost..

JackMan

 It sounds like you are only using 1 output on each Prop-1?  If that's the case, you could easily run all 5 of your props with a single Prop-1. Use a different OUTx for each prop (you'll need to rewrite the code) and connect your solenoids to the appropriate OUTx. When the Prop-1 is triggered it will cycle though all of your props. Shouldn't be any more wiring than you already have because it sounds like you are wired from the EZ-8 to each of the Prop-1's. With a single Prop-1 you will connect each solenoid instead. Just a thought.  ;)

JonnyMac

Mike,

Both the Prop-1 and EZ-8 provide 5vdc on the red wire of those servo headers; what you should do is clip the red wire from at least one end so that you only have ground (black) and signal.  Sorry that I didn't consider this earlier.
Jon McPhalen
EFX-TEK Hollywood Office