by David Ferguson on Sat Nov 06, 2021 3:42 am
As someone that has designed many user interfaces using a very few inputs. I will suggest that you will not like this behavior very much. What happens is that you don't know when you press a button if the value it going to go up or down. If it goes the wrong way (or you want to go the other way), you have to press the button the maximum number of times to get the value you wanted.
A much better solution for multi-value control is to use a pair digital inputs wired to a Single-Pole Double-Throw (SPDT) toggle switch that is of type (Momentary on) - OFF - (Momentary Off). Pushing the switch up would increment the counter, pushing the switch down will decrement the counter. The user always knows whats going to happen, and if they use the wrong button, it's easy to reverse their change.
If you are going to just use a single button, then the "rollover" behavior is usually the best. Button always increments (or decrements), and when it reaches the end it starts back at the beginning.
I like the challenge of what you asked to do, so here is a PDM30 config that uses one button to count 0-1-2-3-2-1-0. I included some other counter samples that I have used as well.
- Attachments
-
Counter Demo PDM30.pdm
- (109.72 KiB) Downloaded 638 times
David Ferguson
Veracity Racing Data