More states for Press/Hold buttons

I’m working wiper and headlight controls, and in both cases it would be very useful to have more than 3 states for Press/Hold buttons. Is there a way to support a Press/Hold algorithm where Press counts up a state, and Hold counts down a state (or vice versa)?

Let’s look at wiper controls. I’ve defined 5 states for my wiper motor: off, intermittent (6s), intermittent (3s), slow continous, fast continuous. Each time I Hold the Active Low button, I would like to go from off to i(6) to i(3) to sc to fc to off. But if I’m driving along in a drizzle, I would like to move from off to i(6) to i(3) and back again without having to go through the continous wiper states. In fact, I’d like to just go from off to i(6) and back again most of the time. Hold to start the wipers, then Press to stop. One button, fairly intuitive. Or at least it seems that way to me.

Any ideas? Can this be done with the existing PMU firmware? (I’m on 101.2.1).

Many thanks!

I have a solution for others to use if they wish: Use a 3 x 3 table based on the current value of a Press/Hold switch and the previous value of the switch. From there create two functions, one for incrementing the wiper state, and one for decrementing the wiper state. Use those two functions in a latching switch, and use the latching switch for the state change in the wipers worksheet.

Now presses go from off to i6 to i3 to sc to fc to off. Holds go the opposite way.