fork download
  1. #include <DHT.h>
  2. #define DHT pin2
  3. #define DHT type DHT11
  4. #define LED-PIN13
  5. #define BUTTON-PIN7
  6. DHT dht (DHTPIN<DHT type);
  7. void setup()
  8. {
  9. pinMode(LED-PIN,OUTPUT);
  10. PINMODE(BUTTON-PIN,INPUT);
  11. dht Begin();
  12. serial begin(9600);
  13. }
  14. void loop()
  15. {
  16. intbutton state = digital read (Button-PIN);
  17. floot temparature = dht read Temparature();
  18. floot humidity + dht.read Humidity();
  19. if(button state ==HIGH//temparature >30)
  20. {
  21. digital write[LED-PIN.HIGH];
  22. }
  23. else
  24. {
  25. digitalwrite(LED-PIN.HIGH);
  26. }
  27. serial.print("Temparature:")'
  28. serial.print(temparature);
  29. serial.print(".c Humidity:");
  30. serial.print(humidity);
  31. serial.println("%");
  32. delay(2000);
  33. }
Success #stdin #stdout 0.02s 25792KB
stdin
Standard input is empty
stdout
#include <DHT.h>
#define DHT pin2
#define DHT type DHT11
#define LED-PIN13
#define BUTTON-PIN7
DHT dht (DHTPIN<DHT type);
void setup()
{
  pinMode(LED-PIN,OUTPUT);
  PINMODE(BUTTON-PIN,INPUT);
  dht Begin();
  serial begin(9600); 
}
void loop()
{
  intbutton state = digital read (Button-PIN);
  floot temparature = dht read Temparature();
  floot humidity + dht.read Humidity();
  if(button state ==HIGH//temparature >30)
{
digital write[LED-PIN.HIGH];
}
else
{
  digitalwrite(LED-PIN.HIGH);
}
serial.print("Temparature:")'
serial.print(temparature);
serial.print(".c Humidity:");
serial.print(humidity);
serial.println("%");
delay(2000);
}