View Single Post
  #6   Spotlight this post!  
Unread 02-02-2010, 22:35
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Programming the Pressure Sensor

This is the section from our Begin.vi involving the compressor. Note that the "Open" block is in a case structure; this allows us to have two sets of IO for our practice and competition robots, and is not required in your setup. We open the compressor and set it's sensor and relay ports, then start it, then set it to a refnum. We don't need it anywhere but here, except to close the compressor in Finish.vi. Once we call "Start", the compressor sets up an interrupt on the pressure switch port and switches the Spike for the compressor on change. You need to do nothing to handle the compressor or pressure switch at all. If you need the status of the pressure switch, then you can use the Compressor Get Refnum to get the refnum and a Get Enabled State to check if the compressor is enabled and if it is on.
Attached Thumbnails
Click image for larger version

Name:	comp.png
Views:	216
Size:	4.1 KB
ID:	8482  
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack