initial upload
This commit is contained in:
parent
500078ef9a
commit
910dc981b5
27 changed files with 3046 additions and 0 deletions
|
@ -0,0 +1,44 @@
|
|||
/***************************************************
|
||||
This is a library for the HTU21D-F Humidity & Temp Sensor
|
||||
|
||||
Designed specifically to work with the HTU21D-F sensor from Adafruit
|
||||
----> https://www.adafruit.com/products/1899
|
||||
|
||||
These displays use I2C to communicate, 2 pins are required to
|
||||
interface
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
|
||||
#if (ARDUINO >= 100)
|
||||
#include "Arduino.h"
|
||||
#else
|
||||
#include "WProgram.h"
|
||||
#endif
|
||||
#include "Wire.h"
|
||||
|
||||
#define HTU21DF_I2CADDR 0x40
|
||||
#define HTU21DF_READTEMP 0xE3
|
||||
#define HTU21DF_READHUM 0xE5
|
||||
#define HTU21DF_WRITEREG 0xE6
|
||||
#define HTU21DF_READREG 0xE7
|
||||
#define HTU21DF_RESET 0xFE
|
||||
|
||||
|
||||
|
||||
class Adafruit_HTU21DF {
|
||||
public:
|
||||
Adafruit_HTU21DF();
|
||||
boolean begin(void);
|
||||
float readTemperature(void);
|
||||
float readHumidity(void);
|
||||
void reset(void);
|
||||
private:
|
||||
boolean readData(void);
|
||||
float humidity, temp;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue