The programming is simple. The idea is that
a switch will return either a true value or a false value corresponding to
whether the switch is being pressed at the moment.
You want the motor
to operate normally when the switch is
returning false (is
not being pressed), and to
be allowed to move only backward when the switch is
returning true (is
being pressed).
I would implement this knowledge as follows:
Code:
if ( ![switch name here].Get() )
{
/* control the motor normally */
}
else
{
if ( [motor name here].Get() > 0 ) // or < 0; test to figure out!
{
[motor name here].Set(0); // necessary: otherwise motor will continue
// at whatever speed you left it at
}
}
Naturally, use the syntax of whatever programming language you're using.
I can't help you with the wiring, since I don't know too much about that stuff.