Unable to turn off "Button" command's autorepeat
SimEnzo
Posts: 21
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
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
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 -->
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
·· 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