79 virtual void TurnOn()
override;
91 virtual void TurnOff()
override;
160 virtual std::string
ToString()
const override;
Abstract base class for every component (sensor, actuator, etc.) the library manages.
Definition: BaseComponent.h:60
Interface for analog-to-digital converter components (e.g.
Definition: AnalogDigitalConverterComponent.h:14
QS-FS01 anemometer wind-speed sensor, read as an analog voltage through an ADC channel.
Definition: QSFS01.h:19
unsigned int myAnalogToDigitalConverterPinIndex
The ADC channel index this sensor reads from.
Definition: QSFS01.h:21
double ConsumePeakWindSpeed()
Returns the peak wind speed seen since the last call, then resets the peak for the next window.
Definition: QSFS01.cpp:202
virtual void TurnOn() override
No-op: the anemometer is passive and reads on demand, so there is nothing to turn on.
Definition: QSFS01.cpp:72
virtual void ProcessRawValues() override
Samples the current wind speed and keeps the highest value seen since the last snapshot consumed the ...
Definition: QSFS01.cpp:102
void SetAnalogDigitalConverter(IAnalogDigitalConverterComponent *analogDigitalConverter)
Sets the ADC this sensor reads through.
Definition: QSFS01.cpp:276
IAnalogDigitalConverterComponent * myAnalogToDigitalConverter
The ADC this sensor reads through.
Definition: QSFS01.h:22
virtual ~QSFS01()
Destroys the sensor, turning it off first.
Definition: QSFS01.cpp:57
QSFS01()
Builds a default anemometer with no ADC wired yet and a zero peak wind speed.
Definition: QSFS01.cpp:15
virtual void TurnOff() override
No-op: the anemometer holds no resources that need releasing when turned off.
Definition: QSFS01.cpp:87
virtual std::string ToString() const override
Serializes the anemometer's raw analog value and calculated wind speed to a string.
Definition: QSFS01.cpp:293
unsigned int GetAnalogToDigitalConverterPinIndex() const
Gets the ADC channel index this sensor reads from.
Definition: QSFS01.cpp:225
void SetAnalogToDigitalConverterPinIndex(unsigned int pinIndex)
Sets the ADC channel index this sensor reads from.
Definition: QSFS01.cpp:259
double CalculateWindSpeed() const
Calculates the current wind speed (m/s) from the ADC's output voltage using the datasheet's 0....
Definition: QSFS01.cpp:152
IAnalogDigitalConverterComponent * GetAnalogDigitalConverter() const
Gets the ADC this sensor reads through.
Definition: QSFS01.cpp:242
double myPeakWindSpeed
Highest wind speed (m/s) seen since the last read.
Definition: QSFS01.h:26
int ReadRawAnalogValue() const
Reads the raw analog value from the ADC, or -1 if no ADC is wired.
Definition: QSFS01.cpp:129
RumPi is the library's top-level facade.
Definition: AlertManager.h:6