How to make a DC motor act as some sort of switch

jremington:
A brushed DC motor is a generator and will produce a voltage, positive or negative, depending on which direction the shaft is rotated.

And the voltage will almost certainly be outside the safe working range (0-5v) for an Arduino.

...R