Even if you can just give me some snippets of code I'd be very grateful.
I've got hundreds of thousands of line of work-related code. I doubt that those would be useful to you.
Post what you have, and we'll help you fix it.
A good description of what you want to have happen, what actually happens, and how those two are different would be good, too.
It isn't that difficult to drive a motor until a switch is pressed, when some action occurs. Knowing HOW the limit switches are wired, to which pins, and which pins the trigger, limit switches, and motor are connect to (indirectly, in the case of the motor) is essential.
Raz6000:
I'm trying to make a motorised gate go between a lower and upper limit switch, only when a remote pin goes high..
Do you mean you want the gate to go to the top when the input is HIGH and go to the bottom when the input is LOW? Is go to the 'other' position each time the input goes HIGH? Or keep cycling back and forth between the two end positions while the input remains HIGH? Or something else?