View Single Post
  #6   Spotlight this post!  
Unread 05-12-2015, 15:26
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Spike Code Problems

Quote:
Originally Posted by GeeTwo View Post
I see two issues:
First, you called relay.set(Relay.Value.kOff); This essentially disables the relay; it won't let either the forward or re reverse direction be enabled. The relay.set is usually called in the initialize method, unless the way in which it operates changes for different parts of the program.

Second, you don't have any way to turn the relay off. The if statement that wraps the relay.setDirection() should have an else case that does this.
I think you're making the same mistake the OP did. setDirection() is called once (if at all) to initialize the allowable directions, while set changes the physical state of the relay.
Reply With Quote