Add resistor, and simplify example by removing const.