November 02, 2024, 08:30:11 AM

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.


Stumped

Started by Jadams, September 08, 2008, 06:42:42 PM

Previous topic - Next topic

Jadams

Ok, I'm stumped on a really simple one.  I want to test a cylinder I made.  I press the switch to extend it, and I want it to retract when I let up.  This is one of Jon's programs but I can't seem to modify it to do what I want.

Thanks,

Jim

' =========================================================================
'
'   File....... 02 - Triggered Prop.BS1
'   Purpose.... Activate prop on trigger input
'   Author..... EFX-TEK, (c) 2006 - All Rights Reserved
'   E-mail..... teamefx@efx-tek.com
'   Started....
'   Updated.... 01 JUN 2006
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


SYMBOL  MatSw   = PIN6
SYMBOL  Valve     = 0

SYMBOL  No         = 0


Main:
  IF MatSw = No THEN Main             ' wait for "victim"
  PAUSE 300                                    ' 3 second pre-delay
  HIGH Valve                                    ' lift prop
  PAUSE 2000                                  ' hold for 5 seconds
  LOW Valve                                    ' retract prop
  PAUSE 200                                     ' 20 second post-delay
  GOTO Main                                     ' back to Main
Jim Adams

JonnyMac

Here you go.  Each actuation has a 1-second delay so that it the valve doesn't fly around too wildly.

' =========================================================================
'
'   File....... 02 - Triggered Prop.BS1
'   Purpose.... Activate prop on trigger input
'   Author..... EFX-TEK, (c) 2006 - All Rights Reserved
'   E-mail..... teamefx@efx-tek.com
'   Started....
'   Updated.... 01 JUN 2006
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


SYMBOL  MatSw           = PIN6
SYMBOL  Valve           = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0


Main:
  IF MatSw = No THEN Main
  HIGH Valve                                    ' lift prop
  PAUSE 1000                                    ' hold 1 second

Check_Release:
  IF MatSw = Yes THEN Check_Release
  LOW Valve                                     ' retract prop
  PAUSE 1000                                    ' hold 1 second

  GOTO Main                                     ' back to Main
Jon McPhalen
EFX-TEK Hollywood Office

Jadams

Thanks Jon,

You sure make it easy for us new guys.  I'm learning.

Jim
Jim Adams