|
|
@ -16,27 +16,26 @@ void setup() { |
|
|
|
} |
|
|
|
|
|
|
|
void loop() { |
|
|
|
float temp = 0, humidity = 0; |
|
|
|
|
|
|
|
int read_error = dhtA.read2(dhtA_pin, &temp, &humidity, NULL); |
|
|
|
Serial.println("Read complete - analysing result"); |
|
|
|
if(read_error != SimpleDHTErrSuccess) { |
|
|
|
Serial.print("Error: Failed reading from the DHT22. Code: "); |
|
|
|
float temp = 0, humidity = 0; |
|
|
|
|
|
|
|
int read_error = dhtA.read2(dhtA_pin, &temp, &humidity, NULL); |
|
|
|
Serial.println("Read complete - analysing result"); |
|
|
|
if(read_error != SimpleDHTErrSuccess) { |
|
|
|
Serial.print("Error: Failed reading from the DHT22. Code: "); |
|
|
|
Serial.println(read_error); |
|
|
|
delay(2000); // We can only read every 2 seconds or so
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
Serial.print("Error code: "); |
|
|
|
Serial.println(read_error); |
|
|
|
delay(2000); // We can only read every 2 seconds or so
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
Serial.print("Error code: "); |
|
|
|
Serial.println(read_error); |
|
|
|
Serial.print("Temperature: "); |
|
|
|
Serial.print(temp); |
|
|
|
Serial.println(" deg celsius"); |
|
|
|
Serial.print("Humidity: "); |
|
|
|
Serial.print(humidity); |
|
|
|
Serial.println("%"); |
|
|
|
Serial.println("*****"); |
|
|
|
|
|
|
|
delay(2000); // We can only read every 2 seconds
|
|
|
|
} |
|
|
|
Serial.print("Temperature: "); |
|
|
|
Serial.print(temp); |
|
|
|
Serial.println(" deg celsius"); |
|
|
|
Serial.print("Humidity: "); |
|
|
|
Serial.print(humidity); |
|
|
|
Serial.println("%"); |
|
|
|
Serial.println("*****"); |
|
|
|
|
|
|
|
delay(2000); // We can only read every 2 seconds
|
|
|
|
} |