Last active
August 29, 2015 14:15
-
-
Save nilsonpessim/f5d3e180a7aaa98adfa2 to your computer and use it in GitHub Desktop.
This file contains 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 <LiquidCrystal.h> | |
#include <DHT.h> | |
#define DHTPIN A5 | |
#define DHTTYPE DHT11 | |
DHT dht(DHTPIN, DHTTYPE); | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
byte grau[8] ={ B00001100, | |
B00010010, | |
B00010010, | |
B00001100, | |
B00000000, | |
B00000000, | |
B00000000, | |
B00000000,}; | |
void setup() | |
{ | |
Serial.begin(9600); | |
lcd.begin(16,2); | |
lcd.clear(); | |
lcd.createChar(0, grau); | |
} | |
void loop() | |
{ | |
float h = dht.readHumidity(); | |
float t = dht.readTemperature(); | |
lcd.setCursor(0,0); | |
lcd.print("Temp : "); | |
lcd.print(" "); | |
lcd.setCursor(7,0); | |
lcd.print(t,1); | |
lcd.setCursor(12,0); | |
lcd.write((byte)0); | |
lcd.setCursor(0,1); | |
lcd.print("Umid : "); | |
lcd.print(" "); | |
lcd.setCursor(7,1); | |
lcd.print(h,1); | |
lcd.setCursor(12,1); | |
lcd.print("%"); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment