Public Member Functions | Public Attributes | Private Member Functions
dht11.DHT11 Class Reference

List of all members.

Public Member Functions

def __init__
def __iter__
def close
def either_edge_callback
def next
def read
def register_callbacks
def setup

Public Attributes

 bit
 checksum
 either_edge_cb
 gpio
 high_tick
 humidity
 pi
 temperature

Private Member Functions

def _edge_EITHER
def _edge_FALL
def _edge_RISE

Detailed Description

The DHT11 class is a stripped version of the DHT22 sensor code by joan2937.
You can find the initial implementation here:
- https://github.com/srounet/pigpio/tree/master/EXAMPLES/Python/DHT22_AM2302_SENSOR

example code:
>>> pi = pigpio.pi()
>>> sensor = DHT11(pi, 4) # 4 is the data GPIO pin connected to your sensor
>>> for response in sensor:
....    print("Temperature: {}".format(response['temperature']))
....    print("Humidity: {}".format(response['humidity']))

Definition at line 10 of file dht11.py.


Constructor & Destructor Documentation

def dht11.DHT11.__init__ (   self,
  pi,
  gpio 
)
pi (pigpio): an instance of pigpio
gpio (int): gpio pin number

Definition at line 24 of file dht11.py.


Member Function Documentation

def dht11.DHT11.__iter__ (   self)
Support the iterator protocol.

Definition at line 137 of file dht11.py.

def dht11.DHT11._edge_EITHER (   self,
  tick,
  diff 
) [private]
Handle Either signal.

Definition at line 112 of file dht11.py.

def dht11.DHT11._edge_FALL (   self,
  tick,
  diff 
) [private]
Handle Fall signal.

Definition at line 100 of file dht11.py.

def dht11.DHT11._edge_RISE (   self,
  tick,
  diff 
) [private]
Handle Rise signal.

Definition at line 71 of file dht11.py.

def dht11.DHT11.close (   self)
Stop reading sensor, remove callbacks.

Definition at line 128 of file dht11.py.

def dht11.DHT11.either_edge_callback (   self,
  gpio,
  level,
  tick 
)
Either Edge callbacks, called each time the gpio edge changes.
Accumulate the 40 data bits from the dht11 sensor.

Definition at line 57 of file dht11.py.

def dht11.DHT11.next (   self)
Call the read method and return temperature and humidity informations.

Definition at line 143 of file dht11.py.

def dht11.DHT11.read (   self)
Start reading over DHT11 sensor.

Definition at line 118 of file dht11.py.

Monitors RISING_EDGE changes using callback.

Definition at line 47 of file dht11.py.

def dht11.DHT11.setup (   self)
Clears the internal gpio pull-up/down resistor.
Kills any watchdogs.

Definition at line 38 of file dht11.py.


Member Data Documentation

Definition at line 27 of file dht11.py.

Definition at line 73 of file dht11.py.

Definition at line 27 of file dht11.py.

Definition at line 27 of file dht11.py.

Definition at line 27 of file dht11.py.

Definition at line 27 of file dht11.py.

Definition at line 27 of file dht11.py.

Definition at line 27 of file dht11.py.


The documentation for this class was generated from the following file:


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Thu Jun 6 2019 20:43:57