How to make software voltage divider?

In short, its a way to replace the potentiometer with a series of distinct values.

Determine which voltages you need.

Build a stack of resistor with multiple resistor segments that will produce the voltage you want (total value of resistors should be 10K to mimic the one you are replacing).

Use a opto fet or relay to connect the selected discrete voltage value to the REF pin.