Skip to content

Voltage Controller

A VoltageController is analagous to a MotorController, but in terms of voltage instead of speed. It adapts the MotorController in order to control it via voltage instead of speed.

Constructor

wom::VoltageController *controller = new wom::VoltageController(frc::MotorController &motorController);

Methods

SetVoltage

Sets the voltage of the controller.

Usage

controller.SetVoltage(12_V);

GetVoltage

Gets the voltage of the controller.

Usage

units::volt_t voltage = controller.GetVoltage();

SetInverted

Sets the inversion of the controller.

Usage

controller.SetInverted(true);

GetInverted

Gets the inversion of the controller.

Usage

bool inverted = controller.GetInverted();

GetEstimatedRealVoltage

Get the estimated real voltage of the output, based on the controller voltage.

Usage

units::volt_t real_voltage = controller.GetEstimatedRealVoltage();

GetBusVoltage

Gets the bus voltage of the controller.

Usage

units::volt_t bus_voltage = controller.GetBusVoltage();