In brushed motors, invented in the 19th century, this is done with a rotary switch on the motor's shaft called a commutator. It consists of a rotating cylinder divided into multiple metal contact segments on the rotor. The segments are connected to wire electromagnet windings on the rotor. Two or more stationary contacts called "brushes", made of a soft conductor like graphite, press against the commutator, making sliding electrical contact with successive segments as the rotor turns, providing electric current to the windings. Each time the rotor rotates by 180° the commutator reverses the direction of the electric current applied to a given winding, so the magnetic field creates a torque in one direction.