Created
March 17, 2019 09:48
-
-
Save Xzenia/657314bf50df6c4caec4292d3f42662c to your computer and use it in GitHub Desktop.
Temperature Sensor code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dht.h> | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); | |
dht DHT; | |
#define DHT11_PIN 2 | |
void setup(){ | |
lcd.begin(16,2); | |
lcd.clear(); | |
} | |
void loop() | |
{ | |
int chk = DHT.read11(DHT11_PIN); | |
lcd.print(String("Temp: ") + String(DHT.temperature)); | |
lcd.setCursor(0,2); | |
lcd.print(String("Humidity: ") + String(DHT.humidity)); | |
delay(2000); | |
lcd.clear(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment