Thread: Spike Relay?
View Single Post
  #2   Spotlight this post!  
Unread 16-01-2012, 19:05
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Spike Relay?

Quote:
Originally Posted by ksafin View Post
We're using the spike relay between our PDB and Compressor, and trying to turn it on by switching the relay to on or off.

By default, when we turn the robot on, the relay doesn't allow the current to flow and power the compressor.

To allow it to do so, and for the compressor to turn on, do we set the relay to kOn or kOff?
There is a class called compressor... it does this for you.

Code:
Compressor compressor = new Compressor(1,2); // 1 is your relay port and 2 is your pressure switch digital input


//then in your robot init just put 
compressor.start();
Reply With Quote