Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::AnalogLoadCell Class Reference

#include <AnalogLoadCell.h>

Inheritance diagram for Boardcore::AnalogLoadCell:
Collaboration diagram for Boardcore::AnalogLoadCell:

Public Member Functions

 AnalogLoadCell (std::function< ADCData()> getVoltage, const float mVtoV, const unsigned int fullScale, const float supplyVoltage=5)
 
bool init () override
 Initialize the sensor.
 
bool selfTest () override
 Check if the sensor is working.
 
void setOffset (const float offset)
 Sets the offset that will be removed from the measured load.
 
void updateOffset (float offset)
 
- Public Member Functions inherited from Boardcore::Sensor< AnalogLoadCellData >
 Sensor ()
 
 Sensor (Sensor &&other)
 
virtual ~Sensor ()
 
void sample () override
 Sample the sensor.
 
virtual AnalogLoadCellData getLastSample ()
 
- Public Member Functions inherited from Boardcore::AbstractSensor
virtual ~AbstractSensor ()
 
SensorErrors getLastError ()
 Get last error for debugging purposes. Avoid silent fails.
 

Protected Member Functions

AnalogLoadCellData sampleImpl () override
 Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
 

Additional Inherited Members

- Public Types inherited from Boardcore::Sensor< AnalogLoadCellData >
using DataType
 
- Protected Attributes inherited from Boardcore::Sensor< AnalogLoadCellData >
DataType lastSample
 
miosix::FastMutex mutex
 
- Protected Attributes inherited from Boardcore::AbstractSensor
SensorErrors lastError = SensorErrors::NO_ERRORS
 

Detailed Description

Definition at line 34 of file AnalogLoadCell.h.

Constructor & Destructor Documentation

◆ AnalogLoadCell()

Boardcore::AnalogLoadCell::AnalogLoadCell ( std::function< ADCData()> getVoltage,
const float mVtoV,
const unsigned int fullScale,
const float supplyVoltage = 5 )
inline

Definition at line 37 of file AnalogLoadCell.h.

Member Function Documentation

◆ init()

bool Boardcore::AnalogLoadCell::init ( )
inlineoverridevirtual

Initialize the sensor.

Returns
boolean value indicating whether the operation succeded or not

Implements Boardcore::AbstractSensor.

Definition at line 44 of file AnalogLoadCell.h.

◆ sampleImpl()

AnalogLoadCellData Boardcore::AnalogLoadCell::sampleImpl ( )
inlineoverrideprotectedvirtual

Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.

Returns
sensor data sample

Implements Boardcore::Sensor< AnalogLoadCellData >.

Definition at line 56 of file AnalogLoadCell.h.

◆ selfTest()

bool Boardcore::AnalogLoadCell::selfTest ( )
inlineoverridevirtual

Check if the sensor is working.

Returns
boolean indicating whether the sensor is correctly working or not

Implements Boardcore::AbstractSensor.

Definition at line 46 of file AnalogLoadCell.h.

◆ setOffset()

void Boardcore::AnalogLoadCell::setOffset ( const float offset)
inline

Sets the offset that will be removed from the measured load.

Definition at line 51 of file AnalogLoadCell.h.

◆ updateOffset()

void Boardcore::AnalogLoadCell::updateOffset ( float offset)
inline

Definition at line 53 of file AnalogLoadCell.h.


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