Hi, i'm new in programming and i don't know how make the code for read two dht11 in a only arduino
This is my code____________________
#include <DHT.h> #define DHTPIN 2 #define DHTTYPE DHT11
int SENSOR = 2;
int SENSOR1= 3;
int temp, humedad;
int temp1, humedad1;
DHT dht (SENSOR,DHT11);
DHT dht (SENSOR1,DHT11);
void setup() {
Serial.begin(9600); // put your setup code here, to run once:
dht.begin();
}
void loop() {
float h=dht.readHumidity(); // in this part i don't know how read the second dht11
float temp = dht.readTemperature();
Serial.println("Temperatura: ");
Serial.println(temp);
Serial.println("°C Humedad: ");
Serial.print(h);
Serial.println("%");
as this is your first posting, pls read carefully the instructions how to use this forum, so that you make it easier for the supporters and readers of your post. You can use the link in my signature to get to the instructions.
So for the future, pls use code tags (</>), when you post your sketch -> see the button leftmost in the quick reply mode.
And: there is a powerful search function within this forum as e.g. your question is not the first of that kind, using multiple DHTxy.