One Button User Interface

you could use a single button that enters a training mode, selects the up or CW position, the CCW position and then returns to the oscillating mode after 3 button presses

Describe how you see this working with one button.

The UI must allow some back-and-forth to "dial in" each position.

You want the operator to nail the up position in one go with a press of the button, and one chance for the lower?

A potentiometer that you turn until it's at one, press the button. Turn until it's the other, press the button again.

Or two buttons for left and right.

Or are you omitting gory details about long and short presses to differentiate switching between modes as opposed to nudging the servo?

Or take multiple attempts to get both things right?

Have you ever adjusted something with a UI that seems designed to make adjustments difficult?

Here to save one part, a pot, or two to save a few push buttons, at the expense of usability as well as complicating the code?

I think the potentiometer would be the best, Three burtons, no different kinds of pressing woukd work well.

A rotary encoder also.

And depending on what the servo ends up needing to push around, there are servomechanisms that do allow external manipulation…

@medcity google "motorized potentiometer", you can get them in linear and rotary styles.

a7

there are 2 modes: run & calibrate

in run mode, the servo alternates between 2 positions with some delay between

pressing the button enters the calibrate mode which immediately moves the servo to the full CCW position and then gradually increments the position in the CW direction.

pressing the button captures the CW position and reverses the direction of the servo.

pressing the captures the CCW position and returns to the run mode alternating between the CW and CCW positions

Yeah, no.

That is not a good user interface. It sounds more like a game you play, "capturing", waiting for the crawling ant to be positioned perfectly to drop the hammer on it.

I wouldn't even enjoy playing that game, let alone adjusting something.

Perhaps the CCW and CW buttons crawl normally, but can be made to go faster if the program button is pressed whilst a direction button is also being pressed.

But the potentiometer sorta wins the day.

I've never liked UIs that use fewer buttons than they might otherwise have done better with.

Tell me you've never cursed when fiddling with something with a lame user interface, and told yourself you could have programmed a better one, maybe using even only the hardware available, but certainly with one or two more switches...

a7

sounded like this was just a learning exercise for the OP

Interesting and timely discussion for me. With only a single Uno pin available, but at least three more functions to code (ideally eight) I’m experimenting at both ends of the spectrum. Comfortable UI competing with versatile function.

One fairly easy to use example of the former (although a pain to get working) detects short, medium and long button presses, giving me my minimum of three function choices. I say ‘fairly’, because conflicts with other code, particularly temperature sensing stuff, have increased those times considerably; a long now gets activated after a tedious 7.2 s!

The other method is more interesting, as it easily allows my existing eight widely different functions to be accessed from the one button. Each press (about 500 ms is needed) increments menuCount during say a 15 s period. When the required choice is reached the pressing stops, the 15 s times out, and that choice is called.

Jury still out on which (if either) I’ll install.

If this was just a learning exercise for @medcity, which is not how I read her original inquiry, here it is not.

@Terrypin do you have a thread on these fora where there is a diagram of all what you have connected to,you nearly exhausted UNO?

I hope you can finish without compromises.

a7

Maybe a learning exercise that includes learning what ppl think about user interfaces.

a7

Afraid not. Just a mess of mostly hand written notes which I soon hope to tidy up. But the devices attached are 16x2 LCD, RTC_DS3231, 2x DS18B20 probes and (predictably?) a DFR MP3 player module.

Edit: the LCD takes most of the pins.

could use an analog input with multiple buttons connecting different resistors to a common resistor resulting in different voltages at the pin

If only..

are you limited by the # of buttons or pins?

what i described allow multiple buttons attached to one pin

Thread split. Please try to stay on topic.

@Terrypin, do not hijack.

Not only a single Uno pin available but also only one remaining input source, which I didn’t make clear, sorry. Anyway, straying even a little from the original topic seems unwelcome by some here…

(From post # 6.)

Hijack? Pleading not guilty. Do you mean my post #6?

I think that was on topic. Its third para might be helpful to the OP.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.