Quote:
Originally Posted by NS_Radication
Correction:
relay.set(Relay.Value.kForward or kReverse)
Should be
relay.setDirection(Relay.Direction.kForward or kReverse, or kBoth);
Hope this helps! Happy Competitions!
|
setDirection() tells it what directions it CAN go in, while set() tells it which direction to actually go. If you're only setting your relay to Value.kOn or Value.kOff, then setting the direction is ok, but it still isn't a good idea because the relay is reinitialized and its value effectively set to kOff on every call to setDirection.
I'm getting all my info about the relay from the source (from sunspotfrcsdk/lib/WPILibJ/src/edu/wpi/first/wpilibj/Relay.java in this case), in case you want to check my info
