Hi, I'm trying to use this very common sensor , but do not know how to do because it uses a function to retrieve values instead of analogRead. Am I wrong? How can I read values from sensors that are in these cases?
// Example testing sketch for various DHT humidity/temperature sensors
include "DHT.h"
DHT dht(A0, DHT22);
void setup()
{
Serial.begin(9600);
dht.begin();
}
void loop()
{
float h = dht.readHumidity();
float t = dht.readTemperature();
}
Hi, I'm trying to use this very common sensor , but do not know how to do because it uses a function to retrieve values instead of analogRead. Am I wrong? How can I read values from sensors that are in these cases?
// Example testing sketch for various DHT humidity/temperature sensors
include "DHT.h"
DHT dht(A0, DHT22);
void setup() { Serial.begin(9600); dht.begin(); }
void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); }