Quote:
Originally Posted by eddie12390
Import the Relay class
Code:
import edu.wpi.first.wpilibj.Relay;
Create a Relay object (I'll call mine Tom)
Code:
Relay Tom = new Relay(PORT YOU PLUGGED THE PWM WIRE INTO ON DSC);
The code to turn the spike on is something like
Code:
Tom.set(Relay.Value.kForward);
I'm not at a computer with the SDK but I'll check with the JavaDocs to make sure this is correct in a moment.
Edit: After a quick check this seems correct. To disable the relay, use this:
Code:
Tom.set(Relay.Value.kOff);
|
Thank you very much. We will be sure to try that when we get our connection to the robot back....