temperature_humidity_dht11

DHT11 library

Author Sebastien Lelong, Copyright (c) 2011, all rights reserved.
Adapted-by
Compiler >=2.4o

Description

DHT11 is a cheap temperature and humidity sensor. This library
accesses this module and reads values from it.
.
Accessing the module is quite straight forward and requires one signal
pin and a pullup resistor. This pin will be set as output and input by the
library itself, and is used to activate the sensor, then actually getting
values. Temp & humidity values comes in one frame from the sensor. Library
split both value type and set global variables. This means these global
variables store the last accessed value.


Sources

  - datasheet: http://www.robotshop.com/PDF/dht11.pdf
  - arduino playground: http://arduino.cc/playground/Main/DHT11Lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions

  • dht11_read() return byte

    Read temperature and humidity value. Expect existing aliases on a signal pin:
    * pin_dht11
    * pin_dht11_direction
    Returns a byte showing result status,using constants defined by the lib:
    DHT11_OK: successful reading, global variables are set
    DHT11_ERR: checksum error while reading
    DHT11_TIMEOUT: too many time occurs before readings, give up.
    Calling code must check these returned value in order to know if
    global variables are actually storing updated values
    


Related samples

Here are the list of samples which use this library:

18f27j5318f27j53_dht11.jal