ASensor
 All Classes Functions Pages
DHTHumiditySensor.h
1 #pragma once
2 /*
3  ASensor - Sensor library. Can be used standalone or in conjunction with AWind library
4  Copyright (C)2015 Andrei Degtiarev. All right reserved
5 
6  You can always find the latest version of the library at
7  https://github.com/AndreiDegtiarev/ASensor
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the MIT license.
11  Please see the included documents for further information.
12 */
13 #include "DHTTemperatureSensor.h"
15 class DHTHumiditySensor : public ISensor
16 {
17 
18  DHTTemperatureSensor *_srcSensor;
19 public:
24  {
25  _srcSensor = src_sensor;
26  }
27 
28 public:
29  virtual const __FlashStringHelper* Name()
30  {
31  return F("DHT Humidity");
32  }
33  virtual float LowMeasurementLimit()
34  {
35  return 1;
36  }
37  virtual float HighMeasurementLimit()
38  {
39  return 100;
40  }
41  virtual int Precission()
42  {
43  return 0;
44  }
45  virtual bool Measure(float &data)
46  {
47  data=_srcSensor->LastHumidity();
48  return _srcSensor->IsOK();
49  }
50 };
Wrapper for DHT temperature and humidity sensor. Humidity is just read from DHTTemperatureSensor. DHTTemperatureSensor has to be referenced in the first constructor parameter. Details to member functions see ISensor class documentation.
Definition: DHTHumiditySensor.h:15
DHTHumiditySensor(DHTTemperatureSensor *src_sensor)
Definition: DHTHumiditySensor.h:23
Wrapper for DHT temperature and humidity sensor. To use this sensor https://github.com/markruys/arduino-DHT library has to be installed. Details to member functions see ISensor class documentation.
Definition: DHTTemperatureSensor.h:14