38 const unsigned int fullScale,
const float supplyVoltage = 5)
39 : getVoltage(getVoltage),
40 conversionCoeff(mVtoV * supplyVoltage / fullScale / 1e3)
44 bool init()
override {
return true; };
51 void setOffset(
const float offset) { this->offset = offset; }
65 data.
load = data.
voltage / conversionCoeff - offset;
74 std::function<
ADCData()> getVoltage;
76 const float conversionCoeff;
AnalogLoadCell(std::function< ADCData()> getVoltage, const float mVtoV, const unsigned int fullScale, const float supplyVoltage=5)
bool selfTest() override
Check if the sensor is working.
void updateOffset(float offset)
bool init() override
Initialize the sensor.
AnalogLoadCellData sampleImpl() override
Read a data sample from the sensor. In case of errors, the method should return the last available co...
void setOffset(const float offset)
Sets the offset that will be removed from the measured load.
Base sensor class with has to be extended by any sensor driver.
This file includes all the types the logdecoder script will decode.
Structure to handle ADC data.