November 21, 2024, 11:05:25 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.


Need a pogram

Started by cooperfan, April 10, 2007, 03:51:54 PM

Previous topic - Next topic

cooperfan

  Hey i'm needing help writing another program. By the way the last one worked great. i need a program that will turn on three motors two led mini spot lights and start the sound when  a switch is turned on.  I'm having three sawblades (foam of coarse)drop out of a ceiling and the spotlights will shine on the blades and i'll have the sound of a saw playing through the sound card. I'm using a Prop 1 Controller and the AP-8 sound card. Also the motors for the saw blades run off of one AA battery each is it possible to power them from the Prop 1 ? Thanks in advance.


Dean

JonnyMac

As always, the devil is in the details.  I can write that program -- I just need to know all the timing and sequencing specifics.  As for the motors, no problem; you'll actually use two 1.5v batteries because of the drop across the ULN.  To use the batteries you'll connect the + terminal of the batts to the respective motors and the - terminal of the batts to the GND terminal on the Prop-1.  Important: the V+ terminal on the Prop-1 will not be connected to the motors, though I suspect that will be the power source for the mini spots.
Jon McPhalen
EFX-TEK Hollywood Office

cooperfan

 Not really much of a timing thing. i'll be hooking an on off switch for the operator to turn on. once its turned on every thing happens at the same time. Lights,Motors Sounds all at once. The blades are spring loaded so the operator controls that part of it.


Dean

JonnyMac

Okay, this one falls into the "no brainer" bin.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7
SYMBOL  Trigger         = PIN6
SYMBOL  Unused5         = PIN5
SYMBOL  LedSpot2        = PIN4
SYMBOL  LedSpot1        = PIN3
SYMBOL  Motor3          = PIN2
SYMBOL  Motor2          = PIN1
SYMBOL  Motor1          = PIN0


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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0


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


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

Reset:
  PINS = %00000000
  DIRS = %00011111

  SEROUT Sio, OT2400, ("!AP8", %00, "X")        ' clear AP-8


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

Main:
  IF Trigger = IsOff THEN Main

  SEROUT Sio, OT2400, ("!AP8", %00, "P", 0)     ' start AP-8
  PINS = %00011111                              ' everything on
  PAUSE 15000                                   ' hold 15 secs

  GOTO Reset                                    ' all off


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


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


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


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


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


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


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