i not have much experience with arduino and need your help . i need switch on / of build in led then temperature rich 27 C . I write scratch but its not work , its read temperature and humidity but led not work , please you help , where is mistake ?
#include <dht.h>
dht DHT;
#define DHT11_PIN 2
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
float chk = DHT.read11(DHT11_PIN);
if ( chk > 27.00 )
digitalWrite( LED_BUILTIN, HIGH);
if ( chk < 27.00 )
digitalWrite( LED_BUILTIN, LOW);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
delay(2000);
}
Thank you