-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHTU21D_Humidity_Temperature.h
52 lines (36 loc) · 1.28 KB
/
HTU21D_Humidity_Temperature.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
51
52
/*
* HTU21D_Humidity_Temperature.h
*
* Created on: 12 août 2017
* Author: Clement ABADIE
*/
#ifndef HTU21D_HUMIDITY_TEMPERATURE_H_
#define HTU21D_HUMIDITY_TEMPERATURE_H_
/*
HTU21D Humidity Sensor Example Code
By: Nathan Seidle
SparkFun Electronics
Date: September 15th, 2013
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Uses the HTU21D library to display the current humidity and temperature
Open serial monitor at 9600 baud to see readings. Errors 998 if not sensor is detected. Error 999 if CRC is bad.
Hardware Connections (Breakoutboard to Arduino):
-VCC = 3.3V
-GND = GND
-SDA = A4 (use inline 10k resistor if your board is 5V)
-SCL = A5 (use inline 10k resistor if your board is 5V)
*/
#include <Wire.h>
//#include "HTU21D.h"
#include <Adafruit_HTU21DF.h>
#define HTU21D_HUMIDITY_CORRECTION_RAMP 1
#define HTU21D_HUMIDITY_CORRECTION_OFFSET 0
#define HTU21D_TEMPERATURE_CORRECTION_RAMP 1
#define HTU21D_TEMPERATURE_CORRECTION_OFFSET 0
//Create an instance of the object
Adafruit_HTU21DF myHumidity;
float value_temperature = 0.0;
float value_humidity = 0.0;
void setup_HTU21D();
void loop_HTU21D();
#endif /* HTU21D_HUMIDITY_TEMPERATURE_H_ */