Code for circuit 8 - Potentiometer