w9ran wrote:Along a similar line, I think it would be useful to have a one-shot option in the UI, so that only changes of state are transmitted wirelessly. In order to implement an adjustment feature using up and down arrows, for instance, I had to "debounce" the variable coming back from RemoteXY to get just one increment per button touch rather than a string of them (like an autorepeat). It would simplify some user interfaces if a button would only generate one change of state indication until it is released again.
Bob
I'm not sure if this would be the best way forward Bob.
It would "fix" a button to be either COS or Continuous, but not both. I reckon some buttons you might want to use both methods in your sketch.
I'm sure there's a comprehensive library for dealing with button handling, I'll see if I can find one. Many devices use a single button for a single increment (or decrement) of a value, for instance, but if "held" for a time the value gets incremented continuously, at a certain rate, which often also accelerates the longer you hold it.
I know I've used a "Debounce" function in the past that tells you which button is just pressed, and has the ability to tell you if a button is "held".
IMHO there'll be too many variable "features" you may require of a button for these to be handled in the UI, this sort of jiggery-pokery best done in the sketch, and the UI just says "button down/button up" as it does now.
EDIT : here's what comes up when you google "arduino button library" ....
https://www.arduino.cc/reference/en/libraries/button/
https://www.arduino.cc/reference/en/lib … n-arduino/
https://www.arduino.cc/reference/en/libraries/ezbutton/
There's loads more, and I'm sure at least one of them will suit your needs ...
2B, or not 2B, that is the pencil ...