View Single Post
  #5   Spotlight this post!  
Unread 20-02-2012, 23:42
kccowan kccowan is offline
Registered User
AKA: Ken Cowan
FRC #1073
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Hollis, NH
Posts: 17
kccowan is an unknown quantity at this point
Re: Need help getting spike relays working

Quote:
Originally Posted by kingpinzs View Post
Code:
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
Reply With Quote