-
Notifications
You must be signed in to change notification settings - Fork 11
/
readme.txt
165 lines (120 loc) · 5.31 KB
/
readme.txt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Texas Instruments HDC2080 Arduino Library
==========================================
***NOTE: This library was originally from https://training.ti.com/how-interface-hdc2010-humidity-and-temperature-sensor-arduino-using-i2c
***This library was originally for the HDC2010 and was converted to support the HDC2080.
Description:
The HDC2080 Library for Arduino allows for configuration and use of
the HDC2080 without the need to use I2C or know the register mapping of
the device.
Feel free to modify and reuse this library as you see fit. This code is
released AS-IS into the public domain. No guarantee or warranty is given.
This code will not be supported by Texas Instruments after release.
---------------------------------------------------------------------------------------
Installation:
Extract or copy the HDC2080 Arduino Library folder into the 'libraries'
folder found in your Arduino Sketchbook. The example sketch will then
be available under 'custom libraries' when you select File-> Examples.
---------------------------------------------------------------------------------------
Contents:
HDC2080.cpp - C++ File defining behavior of HDC2080 methods
HDC2080.h - Header file for HDC2080.cpp
keywords.txt - Keywords from HDC2080.h
library.properties - Properties file for HDC2080 library
Examples - Holds HDC2080 example sketch
----------------------------------------------------------------------------------------
Library Functions:
HDC2010(uint8_t addr)
- Initializes an HDC2080 object
void begin(void)
- Equivalent to wire.Begin(), Joins I2C Bus
float readTemp(void)
- Returns the temperature in degrees C
float readHumidity(void)
- Returns the relative humidity
void enableHeater(void)
- Enables the heating element
void disableHeater(void)
- Disables the heating element
void setLowTemp(float temp)
- Sets the lower temperature threshold (in celcius). Temperature may not
be exact due to 8 bit quantization.
void setHighTemp(float temp)
- Sets the upper temperature threshold (in celcius). Temperature may not
be exact due to 8 bit quantization.
void setHighHumidity(float humid)
- Sets the upper humidity threshold (as a %). Humidity may not
be exact due to 8 bit quantization.
void setLowHumidity(float humid)
- Sets the lower humidity threshold (as a %). Humidity may not
be exact due to 8 bit quantization.
float readLowHumidityThreshold(void)
- Returns contents of low humidity threshold register
float readHighHumidityThreshold(void)
- Returns contents of high humidity threshold register
float readLowTempThreshold(void)
- Returns contents of low temperature threshold register (in C)
float readHighTempThreshold(void)
- Returns contents of high temperature threshold register (in C)
void triggerMeasurement(void)
- Triggers a manual temperature/humidity reading. Use to start
the taking of regular measurements.
void reset(void)
- Triggers a software reset, all registers are returned to default values
void enableInterrupt(void)
- Enables the interrupt/DRDY pin
void disableInterrupt(void)
- Disables the interrupt/DRDY pin (High Z)
uint8_t readInterruptStatus(void)
- Reads the status of the interrupt register. The results can be interpreted
to know which interrupts have been generated. The HDC2010 datasheet explains
the contents of this register.
void clearMaxTemp(void)
- Clears the Maximum temperature register.
void clearMaxHumidity(void)
- Clears the Maximum humidity register
float readMaxTemp(void)
- Reads the maximum temperature register
float readMaxHumidity(void)
- Reads the maximum humidity register
void enableThresholdInterrupt(void)
- Enables high and low temperature/humidity interrupts
void disableThresholdInterrupt(void)
- Disables high and low temperature/humidity interrupts
void enableDRDYInterrupt(void)
- Enables data ready interrupt
void disableDRDYInterrupt(void)
- Disables data ready interrupt
void setTempRes(int resolution)
void setHumidRes(int resolution)
Sets Temperature & Humidity Resolution, 3 options
0 - 14 bit
1 - 11 bit
2 - 9 bit
default - 14 bit
void setMeasurementMode(int mode)
Sets measurement mode, 3 options
0 - Temperature and Humidity
1 - Temperature only
2 - Humidity only
default - Temperature & Humidity
void setRate(int rate)
Sets reading rate, 8 options
0 - Manual
1 - reading every 2 minutes
2 - reading every minute
3 - reading every ten seconds
4 - reading every 5 seconds
5 - reading every second
6 - reading at 2Hz
7 - reading at 5Hz
default - Manual
void setInterruptPolarity(int polarity)
Sets Interrupt polarity, 2 options
0 - Active Low
1 - Active High
default - Active Low
void setInterruptMode(int polarity)
Sets Interrupt mode, 2 options
0 - Level sensitive
1 - Comparator mode
default - Level sensitive