DC motor with 3(or more) programmed limits

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

Where has the servo come from. I thought you had a regular DC motor connected to a motor driver?

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

I can't comment on that because you have not told us where you were measuring the voltage. And I have no idea what it is that is slow.

Also your use of "at the high speed" and "deadly slow" in the same sentence does not make sense to me.

I mean this is the kindest possible way. Your writing reads to me like you are only putting down about 10% of what is in your head. You need to put it all down. If you were talking to someone sitting next to you then you could communicate in a lot less formal way. But we are not sitting next to you and you can't see our body language to judge whether we are understanding you.

...R