Lab_interaccio/2013/DHT_TEST/dht.h

43 lines
728 B
C
Raw Permalink Normal View History

2025-02-25 21:29:42 +01:00
//
// FILE: dht.h
// VERSION: 0.1.05
// PURPOSE: DHT Temperature & Humidity Sensor library for Arduino
//
// URL: http://playground.arduino.cc/Main/DHTLib
//
// HISTORY:
// see dht.cpp file
//
#ifndef dht_h
#define dht_h
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
#define DHT_LIB_VERSION "0.1.05"
#define DHTLIB_OK 0
#define DHTLIB_ERROR_CHECKSUM -1
#define DHTLIB_ERROR_TIMEOUT -2
#define DHTLIB_INVALID_VALUE -999
class dht
{
public:
int read22(uint8_t pin);
double humidity;
double temperature;
private:
uint8_t bits[5]; // buffer to receive data
int read(uint8_t pin);
};
#endif
//
// END OF FILE
//