DC motor with 3(or more) programmed limits

Brinarpi:
First:

const int servoPin = 5; // the pin number for the servo signal

Where can we put this pin?

I wonder if you are completely misunderstanding the purpose of the link I gave you in Reply #25.

All I wanted you to take from that is how to use millis() to time things. I never intended you to use servos or leds.

Unless of course you just want to run my program to learn how it works and perhaps to experiment with changing bits of it. Doing that is a good idea. But if you are doing that keep it completely separate from your other project code

if you are using my program like that then the servo signal wire goes to pin 5. But if you don't have a servo just ignore the servo stuff. The program will not know that there is no servo connected.

if that does not answer your question please explain more clearly what you are trying to do and what the problem is

...R