if (DHT11.humidity == DHT11.humidity+3 ){
This will never be true because the value of the humidity will never be the same as that value plus 3.
I am having trouble understanding what it is you want to have happen, so I am interpreting that you want the LED to come on if the value of humidity changes by 3 or more (whatever that means).
The key is that you need to remember what the value was the time before when you called getdata. So the code needs to look like this:
static int oldValue; // I have this as int but it needs to be the same type as DHT11.humidity
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 - oldvalue >= 3 ){ // new value and old value are different by more than the threshold
digitalWrite (pinLed , HIGH);
delay(1000);
digitalWrite (pinLed , LOW);
}else {
digitalWrite (pinLed , LOW);
}
oldValue = DHT11.humidity; // save the old value for next time
}
}
The 'static' in the definition makes sure that the value remains in the memory between calls to getdata.
There are more elegant ways to do this, but this will do for the moment.
