Quote:
Originally Posted by DomenicR
In your code, you'll want to use the Relay class. You use the Relay#set() method to control the output of the relay:
Code:
// Create the relay
Relay ledRelay = new Relay(RELAY_PORT);
// Control the relay
ledRelay.set(Relay.Value.kOn);
ledRelay.set(Relay.Value.kOff);
|
This will not do what you expect. kOn sets both outputs of the spike to 12v, which will cause a motor or an LED to be off. You should use kForward.
You can use kOn if you set the direction of the relay to Forward only.