Digital counter with analog output
Typically this would be done by making the potentiometer an input to the processor (via an ADC) and having that make a decision.  Especially as it can apply somewhat more sophisticated filtering and decisioning than you can easily accomplish in the analog realm.

Alternately, more in keeping with your stated idea you can use a Digital to Analog converter (DAC) to turn a value in software into an analog voltage.  One crude, but sometimes suitable form of DAC is to use a hardware timer on a processor to generate pulses of varying width (PWM), and then smooth this with a filter made from at least a resistor and capacitor, or perhaps a more sophisticated one.  A key question here will be how smooth the output needs to be, vs. how agile you require it to be in responding to changes of value.  If it only needs to change slowly, it can be made very smooth.  But making an output that is smooth at rest but rapidly changes when required places more challenging demands on the filter, and may be a reason to use a "real" DAC rather than smoothed PWM.

Your question is rather short on details, so a more specific answer will not be possible.  And even if there were more application details, seeking recommendations of specific parts isn't really a permitted goal of questions here.