Harish Mekali
/
ADC_LCD_RTC
ADC_LCD_RTC
Diff: main.cpp
- Revision:
- 0:bd8f447303a6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Feb 18 14:08:21 2013 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD lcd(p19, p20, p21, p22, p23, p24); // rs, e, d0-d3 +AnalogIn a_in(p18); +char time_stamp[16];//as our lcd is of 16 character it is so + +int main() +{ + set_time(1361194897); + while (1) + { + time_t seconds = time(NULL)+ 19800; // time(null) gives the GMT time . + strftime(time_stamp, 16, "%d%m%y%H%M%S", localtime(&seconds)); + //this converts the value in seconds obtained above to human readable format and assigns it to the timestamp + lcd.locate(0,0);//start displaying from zeroth column,zeroth row + lcd.printf("%s",time_stamp);//diplays the human readable time + lcd.locate( 0, 1 ); + lcd.printf( "Temp=%0.3f", a_in * 3.3 * 100 ); + wait( 1.0 ); + } + +} \ No newline at end of file