Potentiometer Function In C