mirror of
https://github.com/adafruit/DHT-sensor-library.git
synced 2023-10-23 22:20:38 +03:00
removed '*' copy error.
This commit is contained in:
parent
57fe95c1be
commit
8b9624479e
8
DHT.cpp
8
DHT.cpp
@ -41,7 +41,7 @@ float DHT::readTemperature(bool S, bool force) {
|
|||||||
case DHT11:
|
case DHT11:
|
||||||
f = data[2];
|
f = data[2];
|
||||||
if (data[3] & 0x80) {
|
if (data[3] & 0x80) {
|
||||||
f *= -1 -f ;
|
f = -1 - f ;
|
||||||
}
|
}
|
||||||
f += (data[3] & 0x0f) * 0.1;
|
f += (data[3] & 0x0f) * 0.1;
|
||||||
if(S) {
|
if(S) {
|
||||||
@ -164,11 +164,11 @@ bool DHT::read(bool force) {
|
|||||||
pinMode(_pin, OUTPUT);
|
pinMode(_pin, OUTPUT);
|
||||||
digitalWrite(_pin, LOW);
|
digitalWrite(_pin, LOW);
|
||||||
switch(_type) {
|
switch(_type) {
|
||||||
case DHT22:
|
case DHT22:
|
||||||
case DHT21:
|
case DHT21:
|
||||||
delayMicroseconds(1100); // data sheet says "at least 1ms"
|
delayMicroseconds(1100); // data sheet says "at least 1ms"
|
||||||
break;
|
break;
|
||||||
case DHT11:
|
case DHT11:
|
||||||
default:
|
default:
|
||||||
delay(20); //data sheet says at least 18ms, 20ms just to be safe
|
delay(20); //data sheet says at least 18ms, 20ms just to be safe
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user