Rotary encoder to update three variables

Hi forumers,

I want to use a single rotary encoder to set three variables within a sketch.

I am thinking the same rotary encoder "read" function could be called three separate times when the setVariable functions are called.

Start Program > set Variable 1 > set variable 2 > set variable 3 > do something with the variables > return to program start.

Am I approaching this correctly?


You will need some method of determining when the three values on the encoder are to be read, some buttons or something. Either that or flash 3 LEDs to tell the user to move the dial or something.


Indeed - always good to give feedback (easy with a LCD display of course), a single LED can give useful feedback by flashing in different ways (an RGB led is even better, many colours as well). Presume you want to step several variables up/down according to the encoder - most have a push-button which is useful for indicating you've finished selecting the value.

Another nice way to give feedback is a piezo bleeper - pitch and duration and different patterns of bleeps means fairly rich feedback possibilities.

Thanks guys, I am looking at using a 16x2 LCD for user feedback.

To be more specific, I want to map a range to each of the three variables to limit user input when turning the rotary.

Are there any good examples of using a rotary with an LCD around?

Thanks again.