using a resistor