November 22, 2024, 04:15:54 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.


Need code for a unit70 Yoggoth

Started by sixhouse, September 07, 2008, 01:18:54 PM

Previous topic - Next topic

sixhouse

This is the first time trying to program a prop with more than one movement, this prop has 4. The prop is a Yoggoth from unit 70. First is lift (back), second is arms up and down, third is head up and down, and forth is head side to side. The prop will be triggered by IR and have sound with an AP-8. for a total run time of 7sec.

JonnyMac

September 07, 2008, 04:10:03 PM #1 Last Edit: September 07, 2008, 04:16:12 PM by JonnyMac
Here's a framework that should get you going.  You will need to fill in the moves section.  Let's say you want the Back and Arms to come up at the same time and hold for half-a-second; you'd code it like this:

  Back = Up
  Arms = Up
  PAUSE 500


Here's the framework:

' =========================================================================
'
'   File...... Yoggoth.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2008 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated... 07 SEP 2008
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN6                  ' SETUP = DN
SYMBOL  HeadSS          = PIN3                  ' head side/side
SYMBOL  HeadUD          = PIN2                  ' head up/down
SYMBOL  Arms            = PIN1
SYMBOL  Back            = PIN0

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

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

SYMBOL  Baud            = OT2400

SYMBOL  Up              = 1
SYMBOL  Down            = 0
SYMBOL  Left            = 1
SYMBOL  Right           = 0


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00001111                              ' make P0-P3 outputs

  SEROUT Sio, Baud, ("!!!!!!AP8", %00, "X")     ' reset


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

Main:
  timer = 0                                     ' reset timer

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * PIR                       ' update timer
  IF timer < 200 THEN Check_Trigger             ' wait for 0.2 sec input

Start_Audio:
  SEROUT Sio, Baud, ("!AP8", %00, "P", 0)

Moves:

  ' put your moves here


  PAUSE 30000                                   ' inter-show delay
  GOTO Main


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


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


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

JonnyMac

You could also use Vixen to create a program for this; see the Vixen section in our Library.
Jon McPhalen
EFX-TEK Hollywood Office