November 22, 2024, 08:34:10 PM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Electric Chair Programming Help!!!!

Started by gremlock, October 20, 2009, 12:36:07 PM

Previous topic - Next topic

gremlock

I just recently purchased the prop1 controller starter kit and some other items and a sound board you guys recommeded for the prop1.  I am finishing up construction on an electric chair am having difficulty with the programming......the wiring is in place but not wired to any particular i/o on the prop 1 yet, so i can wire to any i/o port. Can someone write me a program?  Just to give you an idea as to what i would like the chair to act like, i have included this link:  http://www.youtube.com/watch?v=x0s8EE_6VDU .  I would like to have a 5 minute delay before it can be activated again. 


My electric chair consists of :

1.  fog machine w/  12vdc relay
2.  a 12vdc 4-way solenoid valve for double-acting piston
3.  a light w/  12vdc relay
4. PIR sensor
5.CAR/P-300 audio

JonnyMac

This one's easy.  Note, though, that the prop in the video uses two cylinders: one underneath which causes the body to vibrate up and down, and a second that allows the torso to slump forward.

No worries, you can get a great effect with just one cylinder pushing/pulling the body from the back of the chair -- that's what we do with our mini Chucky Electric Chair.

-- http://www.efx-tek.com/topics/projects.html


Here's your program.  It will need some adjusting if you want to fogger to come on sooner or later, and the show length (presently 10s) will need adjusting for your audio clip.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated... 20 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 @12v

SYMBOL  Fogger          = PIN2                  ' V+/OUT2 to relay
SYMBOL  Chair           = PIN1                  ' V+/OUT1 to valve
SYMBOL  Light           = PIN0                  ' V+/OUT0 to relay


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

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  delay           = W3
SYMBOL  timer           = W4
SYMBOL  lottery         = W5


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

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

 PAUSE 30000                                   ' PIR warm-up


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

Main:
 timer = 0                                     ' reset timer

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

 Light = IsOn
 timer = 0

Start_Audio:
 CARP = IsOn
 PAUSE 50
 CARP = isOff

Shake_It:
 Chair = 1 - Chair                             ' toggle chair valve
 RANDOM lottery                                ' restir random #
 delay = lottery // 201 + 50                   ' 0.05 to 0.25s
 PAUSE delay
 timer = timer + delay

Check_Fog:
 IF timer < 1000 THEN Shake_It                 ' run 1s before smoke
   Fogger = IsOn

Check_Show:
 IF timer < 10000 THEN Shake_It                ' (adjust for audio timing)
   PINS = %00000000                            ' everything off

Program_Delay:                                  ' hold 5 minutes
 FOR timer = 1 TO 5
   PAUSE 60000
 NEXT
 GOTO Main


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


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