sensor v0.1.2 Sensor.Temp.Dht
Get temperature values using the DHT family of sensors. Please see the Sensor.Temp.Dht.Device module’s documentation to see how to install the necessary drivers for your Raspberry Pi or Pi2.
It can be initialize with three parameters, ( DhtType, pin, name ) where name is an atom
The sensor will be polled at 5 second intervals. Calling the read function will return the last reading, without waiting for a new read. This is because the reading process is somewhat slow, especially if the sensor returns an error, in which case, it will pause and then try again.
Summary
Functions
Spawned by the init function in a seperate process, it will request a new reading every 5 seconds. Please note that the reading process my run for many seconds if there are read failures, so the set function is NOT guaranteed to run every 5 seconds
Returns the most recent valid reading
Will update the state with a new reading. Normally only called by the poll_temp function
Will set the temperature value - only used during tests
Starts the DHT temp sensor server.
type
is to identify which type of DHT ( 11 | 22 )
gpio
is the gpio number the sensor is attached to ( ex: 4 )
Functions
Spawned by the init function in a seperate process, it will request a new reading every 5 seconds. Please note that the reading process my run for many seconds if there are read failures, so the set function is NOT guaranteed to run every 5 seconds.
Returns the most recent valid reading
Will update the state with a new reading. Normally only called by the poll_temp function