24 lines
365 B
Arduino
24 lines
365 B
Arduino
|
#include "DHT.h"
|
||
|
|
||
|
DHT dht;
|
||
|
|
||
|
void setup()
|
||
|
{
|
||
|
Serial.begin(9600);
|
||
|
dht.setup(3); // data pin 3
|
||
|
float humidity = dht.getHumidity();
|
||
|
float temperature = dht.getTemperature();
|
||
|
Serial.print(dht.getStatusString());
|
||
|
Serial.print("\t");
|
||
|
Serial.print(humidity, 1);
|
||
|
Serial.print("\t");
|
||
|
Serial.print(temperature, 1);
|
||
|
Serial.print("\n");
|
||
|
|
||
|
}
|
||
|
|
||
|
void loop()
|
||
|
{
|
||
|
|
||
|
}
|