View Single Post
  #2   Spotlight this post!  
Unread 07-02-2009, 17:46
Urban Hawk Urban Hawk is offline
Head of R&D and Head of Scouting
FRC #1886
Team Role: Scout
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Urbana, maryland
Posts: 118
Urban Hawk is infamous around these partsUrban Hawk is infamous around these partsUrban Hawk is infamous around these parts
Re: Clicking spike relay while on

the lighting for a spike is as follows:
for a motor:
Orange - OFF / Brake Condition (default)
Green - Motor rotates in one direction
Red - Motor rotates in opposite direction
Off - OFF / Brake Condition

for a solenoid:
Orange - Both Solenoids OFF (default)
Green - Solenoid connected to M+ is ON
Red - Solenoid connected to M- is ON
Off - Both Solenoids ON

Basicly when it switches from green to red the spike is reversing the direction.

from the code what appears to be happening is that it starts off as isOn = false. Then it enters the first part of the code and isOn changes so now isOn = true. then it looks like the program then goes into the next part of the code and then changes it back to false. Are you sure that you are not looping it because the first time it would go through it would do the first half of the code and the next time through it would switchback.
__________________
FEAR THE HAWK!!!