BayEOSArduino Library
SHT2xSleep.h
1 /*
2  SHT2x - A Humidity Library for Arduino.
3 
4  Created by Christopher Ladden at Modern Device on December 2009.
5 
6  Modified by www.misenso.com on October 2011:
7  - code optimisation
8  - compatibility with Arduino 1.0
9  Modified by Stefan Holzheu 2015
10  - noHold + Sleep
11 
12 
13  This library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU Lesser General Public
15  License as published by the Free Software Foundation; either
16  version 2.1 of the License, or (at your option) any later version.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with this library; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 */
27 
28 
29 #ifndef SHT2X_H
30 #define SHT2X_H
31 
32 #include <inttypes.h>
33 
34 typedef enum {
35  eSHT2xAddress = 0x40,
36 } HUM_SENSOR_T;
37 
38 typedef enum {
39  eTempHoldCmd = 0xE3,
40  eRHumidityHoldCmd = 0xE5,
41  eTempNoHoldCmd = 0xF3,
42  eRHumidityNoHoldCmd = 0xF5,
43  softResetCmd = 0xFE,
44 } HUM_MEASUREMENT_CMD_T;
45 
47 {
48  private:
49  uint16_t readSensor(uint8_t command);
50 
51  public:
52  float GetHumidity(void);
53  float GetTemperature(void);
54  void reset(void);
55  uint8_t isPresent(void);
56 };
57 
58 extern SHT2xClass SHT2x;
59 
60 #endif
Definition: SHT2xSleep.h:47