I2C LCD DHT22
Dependencies: DS3231 RHT03 TextLCD mbed
Fork of I2C-LCD by
Revision 1:d53d1404028c, committed 2015-04-28
- Comitter:
- fookies
- Date:
- Tue Apr 28 06:28:57 2015 +0000
- Parent:
- 0:376d7a150177
- Commit message:
- thanawat
Changed in this revision
diff -r 376d7a150177 -r d53d1404028c DS3231.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS3231.lib Tue Apr 28 06:28:57 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/cromda/code/DS3231/#6718c4fabf95
diff -r 376d7a150177 -r d53d1404028c RHT03.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RHT03.lib Tue Apr 28 06:28:57 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/tristanjph/code/RHT03/#153e20f26d54
diff -r 376d7a150177 -r d53d1404028c main.cpp --- a/main.cpp Wed Dec 03 03:48:48 2014 +0000 +++ b/main.cpp Tue Apr 28 06:28:57 2015 +0000 @@ -1,20 +1,33 @@ #include "mbed.h" #include "TextLCD.h" +#include "DS3231.h" +#include "RHT03.h" //Incluye resistencias de 2.2K en los pines de i2c a 3.3 // I2C Communication -I2C i2c_lcd(p28,p27); // SDA, SCL - -TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2, TextLCD::HD44780); // I2C bus, PCF8574 Slaveaddress, LCD Type, Device Type - +I2C i2c_lcd(D14,D15); // SDA, SCL +DS3231 ds3231(D14,D15); +RHT03 rht(D13); +TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2); // I2C bus, PCF8574 Slaveaddress, LCD Type, Device Type int main() { -lcd.setMode(TextLCD::DispOn); //DispOff, DispOn -lcd.setBacklight(TextLCD::LightOff);//LightOff, LightOn -lcd.setCursor(TextLCD::CurOff_BlkOff);//CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn -lcd.printf("Oscar de Jesus \n Vasquez"); - + lcd.setMode(TextLCD::DispOn); //DispOff, DispOn + lcd.setBacklight(TextLCD::LightOff);//LightOff, LightOn + lcd.setCursor(TextLCD::CurOff_BlkOff);//CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn + //lcd.printf("Oscar de Jesus \n Vasquez"); + //ds3231.setTime(23,57,0); + while(1) + { + int h,m,s; + ds3231.readTime(&h,&m,&s); + rht.readData(); + lcd.setAddress(0,0); + lcd.printf("%02d:%02d:%02d",h,m,s); + lcd.setAddress(0,1); + lcd.printf("T:%.1f H:%.1f",rht.getTemperatureC(),rht.getHumidity()); + wait(1.0); + } } \ No newline at end of file
diff -r 376d7a150177 -r d53d1404028c mbed.bld --- a/mbed.bld Wed Dec 03 03:48:48 2014 +0000 +++ b/mbed.bld Tue Apr 28 06:28:57 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889 \ No newline at end of file