November 21, 2024, 10:42:23 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.


1 Time using step pad

Started by jesmitty23, September 22, 2016, 06:10:07 PM

Previous topic - Next topic

jesmitty23

This is my first attempt at using a step pad with a Prop-1. I'm sure it is something simple I am screwing up, such as wiring or what not. Its a basic 2 cord step pad.

Step pad is triggered then LED turns on and mister fires in intervals . Here is what I've tried



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


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


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

SYMBOL  PIR             = PIN7                  ' SETUP = DN
SYMBOL  Mister          = PIN1
SYMBOL  Light           = PIN0


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

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0


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

SYMBOL  pirTimer        = B2                    ' for debouncing PIR


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

Reset:
  PINS = %00000000
  DIRS = %00000011                              ' set outputs

  PAUSE 30000                                   ' let PIR warm-up


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

Main:
  pirTimer = 0

PIR_Wait:
  PAUSE 10
  pirTimer = pirTimer + 10 * PIR                ' update timer
  IF pirTimer < 250 THEN PIR_Wait

  Light = IsOn
  PAUSE 100
  Mister = IsOn
  PAUSE 1500
  Mister = isoff
  PAUSE 250
  mister = ison
  PAUSE 500
  mister = isoff
  PAUSE 200
  mister = ison
  PAUSE 1000
  mister = isoff
  PAUSE 500
  mister = ison
  PAUSE 750
  mister = isoff
  PAUSE 500
  mister = ison
  PAUSE 1000
  Mister = IsOff
  Light = IsOff

  PAUSE 30000
  GOTO Main


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


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


' -----[ EEPROM Data ]-----------------------------------------------------

JonnyMac

Is something wrong? I tried it on with a Trainer board and it seemed to work just fine.

Tip: You don't nee the PAUSE 30000 at the end of the program because it's already at the top. Change the GOTO Main at the end to GOTO Reset.
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

Do you have the step pad connected to P7.W and P7.R? If so, try using just a button in place of the step pad and see if that triggers the program. If that works, then you have a bad step pad.

jesmitty23

I have it in the P7 and then the ground so maybe that is my issue. Do I need to just get a pin connector and hook it into the WRB pin 7?

JonnyMac

If you're using P7 as the input, get a servo extender, cut it in half (save one half for another project), and then connect your step pad between the RED and WHITE wires. The code is written for this type of input -- and it's easiest as it doesn't require any modifications to the Prop-1.

I copied your code into the editor and changed the trigger to P6 so I could watch it work on a Trainer board. It ran fine.

Generally, I define Prop-1 pins like this:

P7 - reserve for serial IO with external devices like AP-16+
P6 - trigger input (usually active-high)
P5 - output for program
P4 - output for program
P3 - output for program
P2 - output for program
P1 - output for program
P0 - output for program

Jon McPhalen
EFX-TEK Hollywood Office