Ping-Pong with a DC motor & a pot

PaulS:
Varying the motor speed as you get closer to the limit would be a good thing. That's what the PID idea is all about. Sneak up on the limits to avoid overshooting.

You only need to flip the motor direction if it changes, not on every pass through loop.

Your commented out Serial.print() information does not reflect reality.

Thanks for the info. So I should slow down the motor as I get closer to the limit?