May 20, 2024, 07:17:19 AM

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.


prop 1 from the begginning

Started by 277kevy, April 14, 2009, 03:03:26 PM

Previous topic - Next topic

277kevy

once again sorry about my confusion with the emails. I meant nothing harsh. so, i want to drive my car but cant yet. need help with a basic program

lets call this project "DARK SPIDERS"
I will use 4 solenoids with each one going off separately so-  p0, p1 p2 p3 for this. I like your idea using the trainer wheel to adjust the time between p0, p1 p2 p3 I will bag the ap-8 idea. also I can use the pir sensor on the trainer. about 1/4 second to 1 sec for adjustable time. lets cycle thru this 3 time, like p0 p1 p2 p3 p0 p1 p2 p3 p0 p1 p2 p3.

next P4 will use to break a continuous sound I will use . p4 will trigger a separate relay to work the sound, I noticed there are only outputs. anyway this sound should go while P0-P3 are going thru the 3 cycles.

once the prop 1 starts this event the prop controller should not reset for 25 seconds, so the guests wont keep on tripping the controller. so once the pir sensor is triggered about 25 to 30 sec before it can be triggered again.

hope this is detailed enough. let me know if you need more info.
kev

JonnyMac

Here you go.  Be sure to review the Prop-1 and Prop-1 Trainer documentation and note the SETUP jump configuration information in the listing.

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


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


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


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

SYMBOL  Speed           = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  SndCtrl         = PIN4                  ' sound control relay


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

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  idx             = B2                    ' loop controller
SYMBOL  pinNum          = B3                    ' active pin

SYMBOL  timer           = W5


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

Reset:
  PINS = %00000000                              ' start with all off
  DIRS = %00011111                              ' set output pins

  PAUSE 30000                                   ' PIR warm-up, reset delay


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

Read_Speed:
  POT Speed, 100, timer                         ' read speed pot
  timer = timer * 3 + 250                       ' scale to ~250 to ~1000

  DEBUG "Speed = ", #timer, CR

Run_Spiders:
  SndCtrl = IsOn
  FOR idx = 1 TO 3
    FOR pinNum = 0 TO 3
      HIGH pinNum                               ' activate pin
      PAUSE timer                               ' hold
      LOW pinNum
    NEXT
  NEXT
  SndCtrl = IsOff

  GOTO Reset


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


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


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