Code for circuit 3 - DC Motor