WPILibC++  unspecified
AnalogOutput.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2014-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/AnalogOutput.h>
11 
12 #include "ErrorBase.h"
13 #include "SmartDashboard/SendableBase.h"
14 
15 namespace frc {
16 
20 class AnalogOutput : public ErrorBase, public SendableBase {
21  public:
22  explicit AnalogOutput(int channel);
23  ~AnalogOutput() override;
24 
25  void SetVoltage(double voltage);
26  double GetVoltage() const;
27  int GetChannel();
28 
29  void InitSendable(SendableBuilder& builder) override;
30 
31  protected:
32  int m_channel;
33  HAL_AnalogOutputHandle m_port;
34 };
35 
36 } // namespace frc
int GetChannel()
Get the channel of this AnalogOutput.
Definition: AnalogOutput.cpp:64
Definition: RobotController.cpp:14
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
Definition: AnalogOutput.cpp:92
double GetVoltage() const
Get the voltage of the analog output.
Definition: AnalogOutput.cpp:83
AnalogOutput(int channel)
Construct an analog output on the given channel.
Definition: AnalogOutput.cpp:28
MXP analog output class.
Definition: AnalogOutput.h:20
Base class for most objects.
Definition: ErrorBase.h:74
Definition: SendableBase.h:19
Definition: SendableBuilder.h:23
void SetVoltage(double voltage)
Set the value of the analog output.
Definition: AnalogOutput.cpp:71
~AnalogOutput() override
Destructor.
Definition: AnalogOutput.cpp:59