Set value and lock it

Is there a way to set the value of a variable based on the setting of a potentiometer while a jumper is shorted and lock it's value upon removing the jumper? Future potentiometer should do nothing unless the jumper is shorted again. Thank you.

Yes, that's quite straightforward.

1 Like

A "jumper" is a switch. You can test for the switch being on or off and proceed accordingly.
Paul

1 Like

schematics?

When the jumper/switch is closed, read the voltage coming from the potentiometer, save this value in your analog variable.

When the jumper/switch is opened, you no longer update the analog variable.

1 Like

I don't know why I thought it was more complicated. I should have just thought about. Thank you

Thank you. So simple. I don't know why I thought it was more complicated.