WPILibC++  unspecified
frc::AnalogOutput Class Reference

MXP analog output class. More...

#include <AnalogOutput.h>

Inheritance diagram for frc::AnalogOutput:
Collaboration diagram for frc::AnalogOutput:

Public Member Functions

 AnalogOutput (int channel)
 Construct an analog output on the given channel. More...
 
 ~AnalogOutput () override
 Destructor. More...
 
void SetVoltage (double voltage)
 Set the value of the analog output. More...
 
double GetVoltage () const
 Get the voltage of the analog output. More...
 
int GetChannel ()
 Get the channel of this AnalogOutput.
 
void InitSendable (SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const llvm::Twine &errorMessage, Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 
- Public Member Functions inherited from frc::SendableBase
 SendableBase (bool addLiveWindow=true)
 Creates an instance of the sensor base. More...
 
 ~SendableBase () override
 Free the resources used by this object.
 
std::string GetName () const final
 Gets the name of this Sendable object. More...
 
void SetName (const llvm::Twine &name) final
 Sets the name of this Sendable object. More...
 
std::string GetSubsystem () const final
 Gets the subsystem name of this Sendable object. More...
 
void SetSubsystem (const llvm::Twine &subsystem) final
 Sets the subsystem name of this Sendable object. More...
 
- Public Member Functions inherited from frc::Sendable
void SetName (const llvm::Twine &subsystem, const llvm::Twine &name)
 Sets both the subsystem name and device name of this Sendable object. More...
 

Protected Attributes

int m_channel
 
HAL_AnalogOutputHandle m_port
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (const llvm::Twine &errorMessage, const llvm::Twine &contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 
- Protected Member Functions inherited from frc::SendableBase
void AddChild (std::shared_ptr< Sendable > child)
 Add a child component. More...
 
void AddChild (void *child)
 Add a child component. More...
 
void SetName (const llvm::Twine &moduleType, int channel)
 Sets the name of the sensor with a channel number. More...
 
void SetName (const llvm::Twine &moduleType, int moduleNumber, int channel)
 Sets the name of the sensor with a module and channel number. More...
 
- Static Protected Attributes inherited from frc::ErrorBase
static wpi::mutex _globalErrorMutex
 
static Error _globalError
 

Detailed Description

MXP analog output class.

Constructor & Destructor Documentation

AnalogOutput::AnalogOutput ( int  channel)
explicit

Construct an analog output on the given channel.

All analog outputs are located on the MXP port.

Parameters
channelThe channel number on the roboRIO to represent.
AnalogOutput::~AnalogOutput ( )
override

Destructor.

Frees analog output resource.

Member Function Documentation

double AnalogOutput::GetVoltage ( ) const

Get the voltage of the analog output.

Returns
The value in Volts, from 0.0 to +5.0
void AnalogOutput::InitSendable ( SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements frc::Sendable.

void AnalogOutput::SetVoltage ( double  voltage)

Set the value of the analog output.

Parameters
voltageThe output value in Volts, from 0.0 to +5.0

The documentation for this class was generated from the following files: