WPILib 2012
WPILibRoboticsLibraryforFRC
Relay.h
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 RELAY_H_
00008 #define RELAY_H_
00009 
00010 #include "SensorBase.h"
00011 
00012 class DigitalModule;
00013 
00023 class Relay : public SensorBase {
00024 public:
00025         typedef enum {kOff, kOn, kForward, kReverse} Value;
00026         typedef enum {kBothDirections, kForwardOnly, kReverseOnly} Direction;
00027 
00028         Relay(UINT32 channel, Direction direction = kBothDirections);
00029         Relay(UINT8 moduleNumber, UINT32 channel, Direction direction = kBothDirections);
00030         virtual ~Relay();
00031 
00032         void Set(Value value);
00033 
00034 private:
00035         void InitRelay(UINT8 moduleNumber);
00036 
00037         UINT32 m_channel;
00038         Direction m_direction;
00039         DigitalModule *m_module;
00040 };
00041 
00042 #endif
 All Classes Functions Variables