"Lock" a function in loop

Hello!

I sure should need a tip here... I am making an indexer project, and have a rotary encoder hooked up and also three buttons, and what I want to do is to first turn the encoder to a value, and then click the start button. I then want the encoder value to be "locked" so that if you turn the encoder after you press "start" nothing happens?

Any way I can do this?

Any way I can do this?

Set a boolean variable to true and only read the encoder when the variable is true. When the button becomes pressed set the variable to false.

So a if and then state? But all the buttons are monentary buttons.. I plan to have a reset button so after you have completed the run you need to reset if you want to start over and use the encoder again

kjetilhansen: So a if and then state? But all the buttons are monentary buttons.. I plan to have a reset button so after you have completed the run you need to reset if you want to start over and use the encoder again

You need to write some code and post it here so we can see what is in your mind. Otherwise we may just be wasting our time providing the wrong advice.

It is quite possible to write code that can disable and enable encoder readings without needing to restart the Arduino.

...R