November 22, 2024, 02:58:15 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.


Program for the prop-1

Started by Chanter, September 17, 2007, 10:19:50 PM

Previous topic - Next topic

Chanter

September 17, 2007, 10:19:50 PM Last Edit: September 17, 2007, 10:22:51 PM by Chanter
Jon,

Could you help me with a program?  I have the prop-1, and a PIR sensor hooked up to P6.  Then I have a 20 second digital voice recorder hooked up to out0/v+. 

What I want is for the PIR to trip, then pause for 5 seconds. 
Then I want the DVR to activate/play for 20 seconds (it should shut off by its self).
Then I want the PIR to pause/delay for 18 seconds before it will activate again.

Note: the DVR runs off a 9v battery, is that a issue?

Thank you very much for the help!
Chanter


JonnyMac

That one falls into the "no-brainer" category.  Now... you need to find connect OUT0 and GND across the start button, and what you REALLY have to do is make sure you connect the GND terminal to the ground side of the DVR circuit.

' =========================================================================
'
'   File...... Chanter1.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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

' Notes:
' -- move P6 SETUP jumper to DN position
' -- connect DVR ground to GND terminal


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


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

SYMBOL  PIR             = PIN6                  ' SETUP = DN
SYMBOL  DVR             = PIN0                  ' digital voice recorder


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

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


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear everything
  DIRS = %00000001                              ' configure output pin(s)

  PAUSE 18000                                   ' let PIR stabilize
  timer = 0                                     ' clear timer for PIR


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

Main:
  PAUSE 10
  timer = timer + 10 * PIR                      ' update PIR timer
  IF timer < 250 THEN Main                      ' wait for valid signal

  PAUSE 5000                                    ' delay audio start
  DVR = IsOn                                    ' blip DVR
  PAUSE 50
  DVR = IsOff
  PAUSE 20000                                   ' let it play

  GOTO Reset


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


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