hello
i am a beginner in arduino programming
i have searched/google this problem but can not find solution
my question is
i was measuring a voltage from LM317 output voltage
i have managed digitally controlling the pot to set a desire voltage
but yet its hard to get precise voltage that i have set
let say i set 5.2V in my code
the digital pot start running up from 1.25V to 32V
if (mVolt < setVolt) {
clockwise(1, 1);
}
if (mVolt > setVolt) {
anticlockwise(1, 1);
}
where mVolt is the reading of the voltage value
anticlockwise and clockwise is the turning of the pot direction
but the pot keep running backward and forward trying to get a matched 5.2V i have set which is impossible to get precise measurement
so please anybody assist me a code
how to make it stop turing the pot if its already reached +/- 5% from the desire voltage set