View Full Version : Need help getting spike relays working
kingpinzs
20-02-2012, 18:37
Relay hopper;
hopper(1);
if(joybutton(1));
{
hopper.Set(Relay::kOn);
hopper.Set(Relay::kForward);
}
It doesnt do anything at all.
How do I get the spike relays working to test?
Ok, for my code, I don't need the kOn at all.
Is the PWM wire properly plugged into the Relay side of the DSC instead of the PWM side?
Also when the button is pressed, what do the lights next to slot 1 of Relay do?
And do the lights on the Spikes change?
If the answer to the first 2 are yes, and the third no, try messing with the wire more (or a different 1).
SideNote:
WhooHoo, 100 posts!
And congrats on your 1st post!
kingpinzs
20-02-2012, 20:38
1. Yes but both were tried
2. the lights don't even come on
3. the lights don't change
By any chance are the lights on the Relay side red by even when not enabled?
Also are all 3 green lights on the DSC?
Relay hopper;
hopper(1);
if(joybutton(1));
{
hopper.Set(Relay::kOn);
hopper.Set(Relay::kForward);
}
Check out Relay.cpp in WPILib. Relay have a direction, kOn sets both forward and reverse. kForward sets only forward. If it was wired correctly, I'm guessing you want to remove the kOn call.
KC
Alan Anderson
21-02-2012, 01:32
Relays won't do anything if the robot is disabled. Did you enable it from the Driver Station when you ran the test?
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.