WPILibC++  2018.4.1-20180729223220-1149-g7bd3f9f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 "frc/ErrorBase.h"
13 #include "frc/smartdashboard/SendableBase.h"
14 
15 namespace frc {
16 
20 class AnalogOutput : public ErrorBase, public SendableBase {
21  public:
29  explicit AnalogOutput(int channel);
30 
31  ~AnalogOutput() override;
32 
38  void SetVoltage(double voltage);
39 
45  double GetVoltage() const;
46 
50  int GetChannel();
51 
52  void InitSendable(SendableBuilder& builder) override;
53 
54  protected:
55  int m_channel;
56  HAL_AnalogOutputHandle m_port;
57 };
58 
59 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
AnalogOutput(int channel)
Construct an analog output on the given channel.
int GetChannel()
Get the channel of this AnalogOutput.
void InitSendable(SendableBuilder &builder) override
Initializes this Sendable object.
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.
double GetVoltage() const
Get the voltage of the analog output.