End switches
While the motor turns, the green block moves along his shaft and hits the red endswitches.