November 23, 2024, 11:41:23 PM

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.


My first program. Not working

Started by Capt.Chaos, April 06, 2011, 07:33:55 PM

Previous topic - Next topic

Capt.Chaos

Well,
   I received my prop 1 and i just cant seem to get it. I tried to run a program to light a LED for 1 sec on pin 0,pause then run a LED on Pin 2 for 1 sec. I got it to run on pin 0 but nothing else. Could you please show me the program and thn expain how to make it run continuous.

Thanks
Chaos

JackMan

Post the program that you tried and someone can help you out from there, this way you'll be able to see exactly what you may have done wrong.

livinlowe

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

JonnyMac

Here's one way to accomplish what you want.  Programming is flexible, and there are many ways to accomplish the same thing

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


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


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


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


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

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


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

SYMBOL  thePin          = B2


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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00111111                              ' make P0-P5 outputs


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

Main:
  FOR thePin = 0 TO 5                           ' loop through trainer LEDs
    HIGH thePin                                 ' LED on
    PAUSE 1000                                  ' for 1 second
    LOW thePin                                  ' LED off
  NEXT

  GOTO Main                                     ' loop forever


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


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

Capt.Chaos

Thanks. Im starting to get te hang of this...kinda. Anyway, how would you program the prop 1 to randomly wiggl a door handle. In other words, I plan on hooking up a cylinder to wiggle a handle like someone is trying to open it but it's locked. There has to be a way besides alot of high/low codes.
Thanks

bsnut

You may want to look a this thread on RANDOM lottery here http://www.efx-tek.com/php/smf/index.php?topic=1532.0  But, I would also suggest you look at the Basic Stamp Editor help file which will show you more about the RANDOM command and how it's used.

William Stefan
The Basic Stamp Nut

JonnyMac

April 18, 2011, 11:13:10 PM #6 Last Edit: April 18, 2011, 11:16:11 PM by JonnyMac
QuoteIm starting to get te hang of this...kinda.

Well, let me give you a hint about using the forums (grin): one topic/prop/project per thread.  Please post your handle wiggle request in a new thread.  By doing this -- and using descriptive subject lines -- the forums are easier for all of us to search (especially important when we're going fast-and-furious trying to get props working).
Jon McPhalen
EFX-TEK Hollywood Office