documented DHT

This commit is contained in:
Jan Hoffmann committed 2019-07-04 17:06:42 +02:00
1 parent 30809d2a6c
commit dd455428a0
3 files changed
+265 -153

No files matched your search

+34 -23
View File
@@ -1,41 +1,49 @@
/* DHT library
/*!
* @file DHT.h
*
* This is a library for DHT series of low cost temperature/humidity sensors.
*
* You must have Adafruit Unified Sensor Library library installed to use this class.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit andopen-source hardware by purchasing products
* from Adafruit!
*
* Written by Adafruit Industries.
*
* MIT license, all text above must be included in any redistribution
*/
MIT license
written by Adafruit Industries
*/
#ifndef DHT_H
#define DHT_H
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "Arduino.h"
// Uncomment to enable printing out nice debug messages.
/* Uncomment to enable printing out nice debug messages. */
//#define DHT_DEBUG
// Define where debug output will be printed.
#define DEBUG_PRINTER Serial
// Setup debug printing macros.
#define DEBUG_PRINTER Serial /**< Define where debug output will be printed. */
/* Setup debug printing macros. */
#ifdef DHT_DEBUG
#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#else
#define DEBUG_PRINT(...) {}
#define DEBUG_PRINTLN(...) {}
#define DEBUG_PRINT(...) {} /**< Debug Print Placeholder if Debug is disabled */
#define DEBUG_PRINTLN(...) {} /**< Debug Print Line Placeholder if Debug is disabled */
#endif
// Define types of sensors.
#define DHT11 11
#define DHT12 12
#define DHT22 22
#define DHT21 21
#define AM2301 21
/* Define types of sensors. */
#define DHT11 11 /**< DHT TYPE 11 */
#define DHT12 12 /**< DHY TYPE 12 */
#define DHT22 22 /**< DHT TYPE 22 */
#define DHT21 21 /**< DHT TYPE 21 */
#define AM2301 21 /**< AM2301 */
/*!
* @brief Class that stores state and functions for DHT
*/
class DHT {
public:
DHT(uint8_t pin, uint8_t type, uint8_t count=6);
@@ -64,6 +72,9 @@ class DHT {
};
/*!
* @brief Class that defines Interrupt Lock Avaiability
*/
class InterruptLock {
public:
InterruptLock() {