DC motor with 3(or more) programmed limits

I test the code with leds and servo but I am not shure where to connect the pin5 (servo)

The multimeter read max 0,67 Volts at the high speed, and I really dont understand how its work, but it is deadly slow.

A