November 23, 2024, 10:38:10 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Prop-1 & VSA

Started by bfjou812, August 19, 2011, 06:47:02 PM

Previous topic - Next topic

bfjou812

Hi , This is my first  post so Hello to all. I am wondering if I can use VSA to activate the prop -1 . What I want to do is set a program for some LED spots to be run from the prop -1 pins  po - p5 or p6 if possible and not start until the program from vsa starts. I want to use a signal directly from the servo board , Parallax, to start this . Is this possible ? Thanks for your help.

JonnyMac

August 19, 2011, 08:19:10 PM #1 Last Edit: August 19, 2011, 08:20:57 PM by JonnyMac
You need to be a little more clear with your question.  If you want to have a program that looks for a signal (could be an on-off input or even a pulse width) and start a program at that point, yes.  What you cannot expect to do is have the Prop-1 act like a VSA slave to do dimming and servo movements.  Somebody may say, "Yeah, it's possible..." but it's really not practical given the serial restraints of the Prop-1.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

I have some questions based on these two statements.
QuoteWhat I want to do is set a program for some LED spots to be run from the prop -1 pins  po - p5 or p6 if possible and not start until the program from vsa starts.
1) Is the Prop-1 going to be programmed and running a its own program different from the VSA program?
2) Is the Prop-1 going to be setup to dim these LED spots or the spots going to be on when one of the Prop-1 output turns on?
3) Do you know the voltage and current of these LED spots

QuoteI want to use a signal directly from the servo board
Is this signal being controlled by VSA (different board, not Prop-1) and if so do you know the pulse width?




William Stefan
The Basic Stamp Nut

bfjou812

bsnut, the answer to your questions in order are #1 Yes #2 No #3Yes 5 volts .
JonnyMac What I want to do is turn on various spots until the routine is over , the servo board would turn the prop-1 on and off with a signal from VSA .I hope that is a better and more clear explanation, I sometimes have a hard time explaining things , LOL!! Again Thank you for your help.

JonnyMac

Quote...sometimes have a hard time explaining things

We all do, but in the forums it's very important to be clear and specific so that others can help you.  For example: what do you mean by, "the servo board would turn the prop-1 on and off with a signal from VSA."  Does this mean apply power to the board (not a good idea) or provide a signal to the board (better idea)?  Let's assume it's a signal, what kind of signal is coming in?  Is it on or off, or is it a pulse width (e.g., servo control pulse)?

For the sake of fun, let's say it is a servo control pulse that can vary from 1.0ms to 2.0ms.  The Prop-1 can read this signal in 10us units, so it will give a range of 100 to 200.  We can use this a trigger.  Here's a simple version that triggers when the input signal is 150 (1.5ms) or above:

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


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger         = 6                     ' SETUP = DN


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

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  TrOn            = 1                     ' active-high trigger
SYMBOL  TrOff           = 0

SYMBOL  IsOn            = 1                     ' active-high I/O
SYMBOL  IsOff           = 0

SYMBOL  Baud            = OT2400


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

SYMBOL  timer           = B2                    ' for debounce loop


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

Power_Up:
  ' put code here that only happens at power-up/hard reset

Reset:
  PINS = %00000000                              ' all off
  DIRS = %00111111                              ' P5..P0 are outputs


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

Main:
  PULSIN Trigger, 1, timer                      ' measure servo pulse
  IF timer < 150 THEN Main                      ' wait for trigger signal


  ' program code here

  GOTO Reset


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


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


' -----[ User Data ]-------------------------------------------------------


Note that I changed the definition of Trigger from PIN6 to 6 for the PULSIN command.

Jon McPhalen
EFX-TEK Hollywood Office

bfjou812

Thank you very much for your help. I wasnt expecting you to write up a program, but thank you very much!! I really appreciate your help. I guess I need to get the books back out and refresh my memeroy on how to do the programming , it's been a few years. And you were exactly right on what I am trying to do. I just wanted to provide a signal  to the board . Again Thank You very much for your help

JonnyMac

As long as we can post code here in the forums for others to learn from we're happy to help you write code.  If you get stuck, let us know what you want the program to do -- one (or many) of us will jump in and offer suggestions.
Jon McPhalen
EFX-TEK Hollywood Office