November 22, 2024, 04:15:15 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 Questions (New Member Alert!)

Started by jssherrard, May 30, 2008, 02:52:36 AM

Previous topic - Next topic

jssherrard

Howdy!

I just received my Prop-1 starter kit and I am ready to learn. I am already familiar with the Basic programming language which should help my P-Basic learning curve, but there are obviously some significant differences between the two. Here is a little bit about my current project...

I am building a "Haunted Rocking Chair" effect using a MonsterGuts wiper motor, Prop-1 controller, Parallax HB-25 motor controller, PIR sensor, 2 UV LEDs, and a VMusic2 audio player. The HB-25 will allow me to start and stop the rocking smoothly as well as allowing fine control of the rocking speed. The PIR sensor will trigger the Prop-1 to initiate "show-mode", the LEDs will provide effect lighting and the VMusic2 will handle the audio in both "show-mode" and "ambient-mode". Although this seems like a tall order for my first Prop-1 venture, I am excited to get started.

I am wondering, does anyone have some sample code or suggestions for using the HB-25 with the Prop-1?


livinlowe

Welcome!
Well,  this may be obvious, but here is the test program from parallax's website:

' =========================================================================
'   File...... HB-25 Motor Test.bs1
'   Purpose... Tests One HB-25 Connected To P0
'   Author.... Parallax, Inc.
'   E-mail.... support@parallax.com
'   Updated... 08-01-2006
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}

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

' This program tests the HB-25 by waiting for it to power up, then pulsing
' the output to ramp the motor up, wait 3 seconds then ramp back down to a
' stop.  This code was written for one HB-25 connected in Mode 1 (Single)
' to PIN0.


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

SYMBOL          HB25 =  7               ' I/O Pin For HB-25


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

SYMBOL          index = B0              ' Variable Space For Ramp Counter

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

Startup:
IF PIN7 = 0 THEN Startup                ' Wait For HB-25 Power Up (P0)
LET             DIRS =  %10000001       ' Set PIN0 To Output
PAUSE 5                                 ' Wait For HB-25 To Initialize
PULSOUT HB25, 150                       ' Stop Motor
PAUSE 20                                ' Wait 20 mS


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

Main:
  FOR index = 150 TO 200                ' Ramp Up To Full Speed
    PULSOUT HB25, index                 ' Motor Forward
    PAUSE 150                           ' 150 mS Smoothing Delay
  NEXT
  PAUSE 3000                            ' Wait 3 Seconds
  FOR index = 200 TO 150 STEP -1        ' Ramp Back Down
    PULSOUT HB25, index                 ' Motor Forward Slowing
    PAUSE 150                           ' 150 mS Smoothing Delay
  NEXT

Finish:
  GOTO Finish                           ' Prevent PIN0 From Changing State

Controlling the HB-25 seems pretty easy, with a pulsout command dictating speed (similiar to a servo, only speed instead of position).
Here is a post regarding controlling the Vmusic2 with a prop1:

http://www.efx-tek.com/php/smf/index.php?topic=624.0

Hope this helps getting you started!

Shawn
Scaring someone with a prop you built -- priceless!

TomS

     I could use some programming and setup help too.  I have a Prop1, Ap-8, PIR, RC-4 and Crydom relays.   I need to control 4-12vdc solenoid valves and 1-110vac solenoid valve.    The Pro is a multidoor locker.
      What I would like to happen is for the PIR to start the event.   3-12vdc solenoids open and close for a short duration, several times, but not together.  This opens and closes 3 of the locker doors.  It should look random but doesn't have to be as few will see it more than once. 
      Next the AP-8 plays, the last 12vdc solenoid opens, and the 110vac solenoid opens.   There needs to be time for the 12vdc solenoid to open the locker door before the 110vac solenoid opens.   
     What I need is a program that is simple enough for me to change the timimg of the solenoids to get the doors open just right and a wiring diagram so I don't let the smoke out of any components.   Tom 
     

JonnyMac

July 18, 2008, 11:45:44 AM #3 Last Edit: July 18, 2008, 11:48:08 AM by JonnyMac
Please don't "hijack" threads.  Place you questions -- individually -- in separate threads.  Thread hijacking and multiple questions per thread make a real mess of forums, and are major reasons that lots of good internet forums die; we can't let that happen.  We have guidance rules in that make all this clear.  Thanks for understanding.

Forum guidelines: http://www.efx-tek.com/php/smf/index.php?topic=266.0

This thread is now locked.
Jon McPhalen
EFX-TEK Hollywood Office