Lie Detector & Digital Potentiometer

I have done a lie detector with this code. But I need to adjust the Potentiometer every time. Can I use a Digital Potentiometer in the project ? I am poor in coding. Can you please alter the code according to Digital Potentiometer ? thanks in Advance. :smiley:

Wouldn't you have to adjust the Digital Potentiometer, just the same as an analog one?

It is a “fun” project. Lie detectors do not work and have no scientific basis.