test
Dependencies: DS3231 RHT03 TextLCD mbed
Fork of HomeStatus by
Revision 0:894306d5cad7, committed 2015-05-22
- Comitter:
- poomyuttt
- Date:
- Fri May 22 14:25:00 2015 +0000
- Child:
- 1:ae97d85a47dd
- Commit message:
- pro
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS3231.lib Fri May 22 14:25:00 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/cromda/code/DS3231/#6718c4fabf95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RHT03.lib Fri May 22 14:25:00 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/tristanjph/code/RHT03/#153e20f26d54
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Fri May 22 14:25:00 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/oscarvzfz/code/TextLCD/#d824a83e56e3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 22 14:25:00 2015 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "DS3231.h" +#include "RHT03.h" +I2C i2c(D14,D15); +TextLCD_I2C lcd(&i2c,0x4E,TextLCD::LCD16x2); +DS3231 rtc(D14,D15); +RHT03 rht(D13); + +int main() +{ + lcd.setMode(TextLCD::DispOn); + lcd.setBacklight(TextLCD::LightOff); + lcd.setCursor(TextLCD::CurOff_BlkOff); + //rtc.setTime(20,58,00); + //rtc.setDate(5,22,5,2015); + float Temp,Hum; + int dw,d,M,y,h,m,s; + while(1) + { + rtc.readDateTime(&dw,&d,&M,&y,&h,&m,&s); + rht.readData(); + Temp=rht.getTemperatureC(); + Hum=rht.getHumidity(); + lcd.cls(); + lcd.setAddress(0,0); + lcd.printf("%02d/%02d/%4d",d,M,y); + lcd.setAddress(0,1); + lcd.printf("%02d:%02d:%02d",h,m,s); + + wait(3); + lcd.cls(); + lcd.setAddress(0,0); + lcd.printf("Temp:%.1f",Temp); + lcd.setAddress(0,1); + lcd.printf("Hum:%.1f",Hum); + wait(3); + + } + + + return 0; + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri May 22 14:25:00 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file