forked from ericbarch/arduino-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adafruit_HTU21DF.h
50 lines (38 loc) · 899 Bytes
/
Adafruit_HTU21DF.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*!
* @file Adafruit_HTU21DF.h
*/
#ifndef _ADAFRUIT_HTU21DF_H
#define _ADAFRUIT_HTU21DF_H
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Wire.h"
/** Default I2C address for the HTU21D. */
#define HTU21DF_I2CADDR (0x40)
/** Read temperature register. */
#define HTU21DF_READTEMP (0xE3)
/** Read humidity register. */
#define HTU21DF_READHUM (0xE5)
/** Write register command. */
#define HTU21DF_WRITEREG (0xE6)
/** Read register command. */
#define HTU21DF_READREG (0xE7)
/** Reset command. */
#define HTU21DF_RESET (0xFE)
/**
* Driver for the Adafruit HTU21DF breakout board.
*/
class Adafruit_HTU21DF {
public:
Adafruit_HTU21DF();
boolean begin(void);
float readTemperature(void);
float readHumidity(void);
void reset(void);
private:
boolean readData(void);
float _last_humidity, _last_temp;
};
#endif /* _ADAFRUIT_HTU21DF_H */