Integrate Led Status into my DHT Sketch

The readings are changing if im changing the environment, can´t say if they´re accurate. I don´t have any reference values.
How can i change it ?
Thanks for your help :slight_smile:

I had to go back and add in the proper formatting backticks (top and bottom of code). Please check it out and see how it needs to be done for future. Thanks.

As for your code, try increasing the timer interval to around 5 seconds… the DHT11 is notoriously slow and only has a accuracy range of ± 2 deg.

I did it by clicking the preformatted text button in the Editor right here.
Should i just change the refresh time in the app ?

That doesn’t always work properly, which is why the developers show how to do it here:

Change it here:

timer.setInterval(1000L, sendSensor);

Do i need to change the “1000L” ? I apologize for so much questions but im quite new :smiley:
LOL can´t reply anymore :DDDD need to wait 19 Hours
It´s still switching around continously…

unfortunately this makes no change

Received reading from DHT sensor!
LED on V1: green
Received reading from DHT sensor!
LED on V1: green
Failed to read from DHT sensor!
Led on V1: red
Failed to read from DHT sensor!
Led on V1: red
Received reading from DHT sensor!
LED on V1: green
Received reading from DHT sensor!
LED on V1: green
Received reading from DHT sensor!
LED on V1: green
Received reading from DHT sensor!

Yes, the timing is in milliseconds, so 1000 = 1 second. Change it to 5000 for 5 seconds 5500 for 5.5 seconds and so on.

1 Like

Change the position of led1.on to immediately before the ledStatus=true and led1.off just before ledStatus=off.

1 Like