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


Winged Demon

Started by FATMANJOE, October 29, 2008, 03:33:37 PM

Previous topic - Next topic

FATMANJOE

Winged Demon:  prop-1,AP-8 , RC-4 and a PIR

The prop will get triggered and the sound and light will come on than the prop will rise up and hold for 6 seconds and while it is up the wings will flap up and down every ½ second and after the 6 second time everything can go off at once.  I will use one solenoid and cylinder to lift the prop and one solenoid and cylinder for the wings.
Trigger PIR
AP-8 starts audio
RC-4 activate light
Solenoid # 1 on and holds for 6 seconds
Solenoid #2 on and fires on and off every ½ second within the 6 seconds
Everything off
Delay one minute before next  activation



JonnyMac

' =========================================================================
'
'   File...... Winged_Demon.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... 29 OCT 2008
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN

SYMBOL  Wings           = PIN1
SYMBOL  Riser           = PIN0


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

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

SYMBOL  IsUp            = 1
SYMBOL  IsDown          = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  Baud            = OT2400                ' B/R jumper removed


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

SYMBOL  relays          = B0
SYMBOL   Light          =  BIT0
SYMBOL   K2             =  BIT1
SYMBOL   K3             =  BIT2
SYMBOL   K4             =  BIT3

SYMBOL  timer           = B2
SYMBOL  sfx             = B3
SYMBOL  idx             = B4


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

Reset:
  PINS = %00000000                              ' clear all
  DIRS = %00100011                              ' set outputs

  SEROUT Sio, Baud, ("!!!!!AP8", %00, "X", "!RC4", %00, "X")
  relays = %0000

  PAUSE 60000


' -----[ 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

  sfx = 0
  GOSUB Play_AP8

  Light = IsOn
  GOSUB Set_RC4

  Riser = IsUp

  FOR idx = 1 TO 3
    Wings = IsOn
    PAUSE 500
    Wings = IsOff
    PAUSE 500
  NEXT

  GOTO Reset


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

Play_AP8:
  SEROUT Sio, Baud, ("!AP8", %00, "P", sfx)
  RETURN

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

Set_RC4:
  SEROUT Sio, Baud, ("!RC4", %00, "S", relays)
  RETURN

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


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