peary::board::carboard::ADCInput

ADC input resource for CaR board.

#include <peary/hardware/boards/Carboard.hpp>

Inherits from peary::hal::VoltageProvider, peary::hal::Resource

Public Functions

Name
ADCInput(component::ADS7828 & adc, component::ADS7828::Channel channel)Constructor for ADCInput class.
virtual double getVoltage() overrideGet the voltage from the ADC channel.

Additional inherited members

Public Functions inherited from peary::hal::Resource

Name
virtual ~Resource() =defaultDefault constructor.
void setName(const std::string & name)Set the name of the resource.
std::string name() constGet the name of the resource.

Protected Attributes inherited from peary::hal::Resource

Name
std::string _name

Public Functions Documentation

function ADCInput

  inline ADCInput(
    component::ADS7828 & adc,
    component::ADS7828::Channel channel
)
  

Constructor for ADCInput class.

Parameters:

  • adc Reference to the ADS7828 component
  • channel The channel to read from

function getVoltage

  inline virtual double getVoltage() override
  

Get the voltage from the ADC channel.

Return: The voltage read from the ADC channel

Reimplements: peary::hal::VoltageProvider::getVoltage


Updated on 2025-11-14 at 11:31:23 +0100