Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
FlowSensor Class Reference

Read flow rate using a Omron D6F-P0010 MEMS flow sensor. More...

#include <FlowSensor.h>

Public Member Functions

 FlowSensor (uint8_t pin)
 Constructor.
 
double readFlowrate () const
 Read the flow rate.
 

Private Attributes

const uint8_t pin
 

Static Private Attributes

static constexpr double coeffs []
 Coefficients of the polynomial approximation to the sensor response (and voltage mapping)
 

Detailed Description

Read flow rate using a Omron D6F-P0010 MEMS flow sensor.

Definition at line 9 of file FlowSensor.h.

Constructor & Destructor Documentation

◆ FlowSensor()

FlowSensor::FlowSensor ( uint8_t pin)
explicit

Constructor.

Parameters
pinSensor pin number

Definition at line 6 of file FlowSensor.cpp.

Member Function Documentation

◆ readFlowrate()

double FlowSensor::readFlowrate ( ) const

Read the flow rate.

Returns
flow rate (L/min)

Definition at line 8 of file FlowSensor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ coeffs

constexpr double FlowSensor::coeffs[]
staticconstexprprivate
Initial value:
= {
0.094003 * ipow(3.3 / 1023, 5),
-0.564312 * ipow(3.3 / 1023, 4),
1.374705 * ipow(3.3 / 1023, 3),
-1.601495 * ipow(3.3 / 1023, 2),
1.060657 / 1023 * 3.3,
-0.269996,
}
constexpr T ipow(T base, unsigned int pow)
Constexpr function for computing integer power.
Definition imath.h:10

Coefficients of the polynomial approximation to the sensor response (and voltage mapping)

Definition at line 13 of file FlowSensor.h.

◆ pin

const uint8_t FlowSensor::pin
private

Definition at line 11 of file FlowSensor.h.


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