Arduino 12VDC motor controller with limits

Vernon333:
I found this code on the net, what I know is very very limited. Please excuse me, but where would I add the piece of code you just sent?

You have a go at figuring that out and if you can't get it to work then post your best attempt and I will try to help.

...R