Thread: Pressure switch
View Single Post
  #3   Spotlight this post!  
Unread 09-02-2013, 17:29
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Pressure switch

You can also use the Compressor object in WPILib. The way it works is to start a background thread that polls the pressure switch periodically and turns the compressor on and off by itself. So you don't need loops and don't need to look at the switch or operate the Spike relay that controls the compressor.

To use it see this page for a C++ example, but the Java version is almost the same:

http://wpilib.screenstepslive.com/s/...for-pneumatics

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote