From page 39 of the WPI Robotics Library Users' Guide, available
here (
this page should be the apple of your programmer's eye for the next several weeks):
Code:
Relay m_relay(1);
m_relay.SetDirection(Relay::kReverseOnly);
m_relay.Set(Relay::kOn);
(trimmed for my purposes here; see the original document for the entire example)
This code commands a relay on port 1 to drive in reverse. To turn it off, you'd do a
Code:
m_relay.Set(Relay::kOff);
Does that work out for you?
EDIT: You'll really want to read page 38 of that manual. It does a much better job of detailing how to command a relay than I just did.