WPILib 2012
WPILibRoboticsLibraryforFRC
|
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2008. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #ifndef COMPRESSOR_H_ 00008 #define COMPRESSOR_H_ 00009 00010 #define COMPRESSOR_PRIORITY 90 00011 00012 #include "SensorBase.h" 00013 #include "Relay.h" 00014 #include "Task.h" 00015 00016 class DigitalInput; 00017 00025 class Compressor: public SensorBase 00026 { 00027 public: 00028 Compressor(UINT32 pressureSwitchChannel, UINT32 compressorRelayChannel); 00029 Compressor(UINT8 pressureSwitchModuleNumber, UINT32 pressureSwitchChannel, 00030 UINT8 compresssorRelayModuleNumber, UINT32 compressorRelayChannel); 00031 ~Compressor(); 00032 00033 void Start(); 00034 void Stop(); 00035 bool Enabled(); 00036 UINT32 GetPressureSwitchValue(); 00037 void SetRelayValue(Relay::Value relayValue); 00038 00039 private: 00040 void InitCompressor(UINT8 pressureSwitchModuleNumber, UINT32 pressureSwitchChannel, 00041 UINT8 compresssorRelayModuleNumber, UINT32 compressorRelayChannel); 00042 00043 DigitalInput *m_pressureSwitch; 00044 Relay *m_relay; 00045 bool m_enabled; 00046 Task m_task; 00047 }; 00048 00049 #endif 00050