Skip to content

Commit f40ac2e

Browse files
author
dam74
committed
1.0.6
1 parent ef9a384 commit f40ac2e

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

DHT22.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ uint8_t DHT22::readSensor(){
140140
}
141141

142142
String DHT22::debug(){
143-
String d = "### DEDUG ###\nlook at datasheet for timing specs\n";
143+
String d = "### BEGIN DEDUG ###\nlook at datasheet for timing specs\n";
144144
measureTimings();
145145

146146
d +="t_80L\tt_80H\tt_50\tt_Bit0\tt_Bit1\n";
@@ -159,7 +159,7 @@ String DHT22::debug(){
159159
d += String(getHumidity(),1) +"\t";
160160
d += String(getTemperature(),1) +"\t";
161161
if (err != ERR_CRC) d+="TRUE"; else d+="FALSE";
162-
d+="\n### DEDUG ###";
162+
d+="\n### END DEDUG ###";
163163
return d;
164164
}
165165

DHT22.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class DHT22{
3333
uint8_t _timingBit0 = 27; //specs for AM2303
3434
uint8_t _timingBit1 = 70; //specs for AM2303
3535
bool _firstStart=true;
36-
uint8_t _lastError;
36+
error _lastError;
3737

3838
const uint8_t T = 30;
39-
const uint16_t cSamplingTime = 2100; // ms, dht22 sampling rate ~0.5Hz
39+
const uint16_t cSamplingTime = 2100; // ms : dht22 sampling rate ~0.5Hz
4040

4141
public:
4242
DHT22(uint8_t pinData){

examples/dht22test/dht22test.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ void setup() {
1010
}
1111

1212
void loop() {
13-
//Serial.println(dht22.debug()); //optionnal
13+
Serial.println(dht22.debug()); //optionnal
1414

1515
float t = dht22.getTemperature();
1616
float h = dht22.getHumidity();
1717

18-
if (dht22.getLastError() != dht22.OK)
18+
if (dht22.getLastError() != dht22.OK) {
19+
Serial.print("last error :");
1920
Serial.println(dht22.getLastError());
21+
}
2022

2123
Serial.print("h=");Serial.print(h,1);Serial.print("\t");
2224
Serial.print("t=");Serial.println(t,1);
23-
delay(1000);
25+
delay(2000); //Collecting period should be : >1.7 second
2426
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=DHT22
2-
version=1.0.5
2+
version=1.0.6
33
author=dvarrel
44
maintainer=dvarrel
55
includes=DHT22.h

0 commit comments

Comments
 (0)