WPILibC++  2018.4.1-20180819203220-1159-g83cfb8b
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
DoubleSolenoid.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <hal/Types.h>
11 
12 #include "frc/SolenoidBase.h"
13 
14 namespace frc {
15 
23 class DoubleSolenoid : public SolenoidBase {
24  public:
25  enum Value { kOff, kForward, kReverse };
26 
35  explicit DoubleSolenoid(int forwardChannel, int reverseChannel);
36 
44  DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel);
45 
46  ~DoubleSolenoid() override;
47 
53  virtual void Set(Value value);
54 
60  virtual Value Get() const;
61 
71  bool IsFwdSolenoidBlackListed() const;
72 
82  bool IsRevSolenoidBlackListed() const;
83 
84  void InitSendable(SendableBuilder& builder) override;
85 
86  private:
87  int m_forwardChannel; // The forward channel on the module to control.
88  int m_reverseChannel; // The reverse channel on the module to control.
89  int m_forwardMask; // The mask for the forward channel.
90  int m_reverseMask; // The mask for the reverse channel.
91  HAL_SolenoidHandle m_forwardHandle = HAL_kInvalidHandle;
92  HAL_SolenoidHandle m_reverseHandle = HAL_kInvalidHandle;
93 };
94 
95 } // namespace frc
bool IsRevSolenoidBlackListed() const
Check if the reverse solenoid is blacklisted.
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
Definition: SolenoidBase.h:19
bool IsFwdSolenoidBlackListed() const
Check if the forward solenoid is blacklisted.
virtual void Set(Value value)
Set the value of a solenoid.
DoubleSolenoid class for running 2 channels of high voltage Digital Output (PCM). ...
Definition: DoubleSolenoid.h:23
virtual Value Get() const
Read the current value of the solenoid.
Definition: SendableBuilder.h:23
DoubleSolenoid(int forwardChannel, int reverseChannel)
Constructor.