A detent is a mechanical or magnetic means to resist or arrest the rotation of a wheel, axle, or spindle. Such a device can be anything ranging from a simple metal pin to a machine. The term is also used for the method involved.
Magnetic detents are most often used to divide a shaft rotation into discrete increments. Magnetic detents are inherent in some types of electric motors, most often stepper motors.