mysensors/co_temp_sensor/lib/DHT
Simon 8cdca78b4f Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
..
examples/DHT_Test Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
DHT.cpp Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
DHT.h Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
README.md Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
keywords.txt Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
license.txt Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00
readme.pdf Version 1. Gateway + tempHum 2017-04-01 20:58:16 +02:00

README.md

DHT

An Arduino library for reading the DHT family of temperature and humidity sensors.

Written by Mark Ruys, mark@paracas.nl.

Features

  • Support for DHT11 and DHT22, AM2302, RHT03
  • Auto detect sensor model
  • Low memory footprint
  • Very small code

Usage

#include "DHT.h"

DHT dht;

void setup()
{
  Serial.begin(9600);

  dht.setup(2); // data pin 2
}

void loop()
{
  delay(dht.getMinimumSamplingPeriod());

  Serial.print(dht.getHumidity());
  Serial.print("\t");
  Serial.print(dht.getTemperature());
}

Also check out the example how to read out your sensor. For all the options, see dht.h.

Installation

Place the DHT library folder in your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the Arduino IDE.