Hi I really need help: =(
I am working in an artist proyect.
I think this is a simple thing, but i have investigated and not found much;
i have a dht11 temperature an humidity sensor of 4 pins, and am trying to turn on a led for a moment and then turn it off
whith the changes humedity values.
I nedd to respond when a person breaths near of the sensor, so I already use the librery and Its enough that the led activate with
the change of tow or three values but i cant di that because i dont already undestand how the sensor works.
Here I have what i change in the code.
Thanks a lot, i hope you can help me!
Sorry about my english.
#include <dht11.h>
dht11 DHT11;
int pinLed = 6;
float valorActual;
float valorhumedad;
float un;
int iPuerto =4;
void setup()
{
Serial.begin(9600);
}
void getdata(int iPuerto)
{
valorActual = DHT11.humidity,(iPuerto);
int chk = DHT11.read(iPuerto);
Serial.print("Sensor");
Serial.print(iPuerto);
Serial.print(" ");
switch (chk)
{
case 0:
Serial.println((float)DHT11.humidity,(iPuerto));
Serial.println(" % ");
Serial.println((float)DHT11.temperature,(iPuerto));
Serial.println(" o C");
break;
case -1: Serial.println(" Checksum error"); break;
case -2: Serial.println(" Time out error"); break;
default: Serial.println(" Unknown error"); break;
if (DHT11.humidity == DHT11.humidity+3 ){
digitalWrite (pinLed , HIGH);
delay(1000);
digitalWrite (pinLed , LOW);
}else {
digitalWrite (pinLed , LOW);
}
}
}
void loop()
{
getdata(iPuerto);
delay(400);
}