WPILibC++ 2023.4.3-108-ge5452e3
frc::AnalogOutput Class Reference

MXP analog output class. More...

#include <frc/AnalogOutput.h>

Inheritance diagram for frc::AnalogOutput:
wpi::Sendable wpi::SendableHelper< AnalogOutput >

Public Member Functions

 AnalogOutput (int channel)
 Construct an analog output on the given channel. More...
 
 ~AnalogOutput () override
 
 AnalogOutput (AnalogOutput &&)=default
 
AnalogOutputoperator= (AnalogOutput &&)=default
 
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 () const
 Get the channel of this AnalogOutput. More...
 
void InitSendable (wpi::SendableBuilder &builder) override
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::Sendable
virtual ~Sendable ()=default
 
virtual void InitSendable (SendableBuilder &builder)=0
 Initializes this Sendable object. More...
 
- Public Member Functions inherited from wpi::SendableHelper< AnalogOutput >
 SendableHelper (const SendableHelper &rhs)=default
 
 SendableHelper (SendableHelper &&rhs)
 
SendableHelperoperator= (const SendableHelper &rhs)=default
 
SendableHelperoperator= (SendableHelper &&rhs)
 

Protected Attributes

int m_channel
 
hal::Handle< HAL_AnalogOutputHandlem_port
 

Additional Inherited Members

- Protected Member Functions inherited from wpi::SendableHelper< AnalogOutput >
 SendableHelper ()=default
 
 ~SendableHelper ()
 

Detailed Description

MXP analog output class.

Constructor & Destructor Documentation

◆ AnalogOutput() [1/2]

frc::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()

frc::AnalogOutput::~AnalogOutput ( )
override

◆ AnalogOutput() [2/2]

frc::AnalogOutput::AnalogOutput ( AnalogOutput &&  )
default

Member Function Documentation

◆ GetChannel()

int frc::AnalogOutput::GetChannel ( ) const

Get the channel of this AnalogOutput.

◆ GetVoltage()

double frc::AnalogOutput::GetVoltage ( ) const

Get the voltage of the analog output.

Returns
The value in Volts, from 0.0 to +5.0

◆ InitSendable()

void frc::AnalogOutput::InitSendable ( wpi::SendableBuilder builder)
overridevirtual

Initializes this Sendable object.

Parameters
buildersendable builder

Implements wpi::Sendable.

◆ operator=()

AnalogOutput & frc::AnalogOutput::operator= ( AnalogOutput &&  )
default

◆ SetVoltage()

void frc::AnalogOutput::SetVoltage ( double  voltage)

Set the value of the analog output.

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

Member Data Documentation

◆ m_channel

int frc::AnalogOutput::m_channel
protected

◆ m_port

hal::Handle<HAL_AnalogOutputHandle> frc::AnalogOutput::m_port
protected

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