Shop OBEX P1 Docs P2 Docs Learn Events
Unable to turn off "Button" command's autorepeat — Parallax Forums

Unable to turn off "Button" command's autorepeat

SimEnzoSimEnzo Posts: 21
edited 2006-03-17 00:49 in BASIC Stamp
I'm using a BS2sx that came assembled and am trying to use the button command with autorepeat turned off. The Button command is working with the exception that it does the repeat.

Here's the code:

BUTTON ConveyorBtn1, 1, 255, 100, btnWrk, 1, CvyBtn1Click

In that code ConveyorBtn1 is set to a PIN and btnWrk is a BYTE variable. Again, it works, but does the auto-repeat despite the third argument being set to 255. I've also tried setting that parameter to 0, but it still repeats.

Any suggestions would be most welcome!

Ethan

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-03-16 23:57
    Ethan -

    What kind of input device is providing the switch closure? What you may be seeing is a lack of de-bouncing rather than auto-repeat.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • SimEnzoSimEnzo Posts: 21
    edited 2006-03-17 00:16
    I'm using a microswitch that comes with an illuminated arcade button (bought from Happ Controls).·I did play around with the various bounce & autorepeat settings, oo no avail.

    I think I know the source of my problems (it occurred to me on my drive into work)--I'm sharing the byte workspace variable among several different buttons.· Having given it some consideration, I suppose the work space variable has data that is supposed to persist between cycles, and I need to have a different variable dedicated to each "button" command.

    Ethan
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-17 00:49
    Ethan,

    ·· You should never share the work variables among other buttons.· That is most likely what is causing your problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.