May 03, 2024, 06:50:05 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.


Changing program parameters on the fly

Started by Jadams, February 26, 2011, 11:13:15 AM

Previous topic - Next topic

Jadams

Using this program as an example, is there any way to change the 'Pause' value on the fly?


Main:
  Valve1 = IsOff
  IF Trigger = IsOff THEN Main
  Valve1 = IsOn
  PAUSE 100


  GOTO Main
Jim Adams

JackMan

A Prop-Pot would be the best way without reprogramming the Prop-1.

Jadams

I finally got it to work.  I tried several times in the past to use the POT feature but couldn't figure it out.  Then I reviewed all the post on the subject and figured out the Prop 1 I was using has a problem with PIN7.  I knew it from past projects but had forgotten.  As soon as I put the trainer on a different Prop.......it worked.  Using debug I see a range from 1 to about 30.

Thanks for your suggestion.


Main:
  POT 7, 98, delay
  Valve1 = IsOff
  IF Trigger = IsOff THEN Main
  Valve1 = IsOn
  delay = delay * 35/100
  PAUSE delay

  GOTO Main
Jim Adams

bsnut

You did good job with your code Jim. I just want to add a point for future reference, so you can have more flexibility in your timing.

As you know, the POT instruction scale value is an byte value and can be increase to the maximum of 255. By doing this, you should see your result from the POT increase as well. This can be seen best, by using the POT scaling feature in the Basic Stamp Editor, by doing the following keyboard shortcut Alt+Pot.
William Stefan
The Basic Stamp Nut