forked from adafruit/DHT-sensor-library
Support for non 16mhz devices
Added constructor parameter to allow for different timing needs. It has the a default value of 6 which is the original value, so it should be backwards compatible
This commit is contained in:
@@ -6,9 +6,10 @@ written by Adafruit Industries
|
||||
|
||||
#include "DHT.h"
|
||||
|
||||
DHT::DHT(uint8_t pin, uint8_t type) {
|
||||
DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) {
|
||||
_pin = pin;
|
||||
_type = type;
|
||||
_count = count;
|
||||
firstreading = true;
|
||||
}
|
||||
|
||||
@@ -129,7 +130,7 @@ boolean DHT::read(void) {
|
||||
if ((i >= 4) && (i%2 == 0)) {
|
||||
// shove each bit into the storage bytes
|
||||
data[j/8] <<= 1;
|
||||
if (counter > 6)
|
||||
if (counter > _count)
|
||||
data[j/8] |= 1;
|
||||
j++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user