Project

Dependencies:   Hotboards_keypad TextLCD eeprom

LCDDisplay.cpp

Committer:
shivanandgowdakr
Date:
2019-09-16
Revision:
1:1894419d5def
Parent:
0:194ff03a2e6a

File content as of revision 1:1894419d5def:

#include "mbed.h"
#include "TextLCD.h"
#include <string>
#include "Time.h"

#define     LCD_RS                      PC_2
#define     LCD_EN                      PC_3
#define     LCD_D4                      PA_13
#define     LCD_D5                      PA_14
#define     LCD_D6                      PA_15
#define     LCD_D7                      PB_7



TextLCD lcd {LCD_RS,LCD_EN,LCD_D4,LCD_D5,LCD_D6,LCD_D7,TextLCD::LCD16x2};


void Display_LCD(int col,int row,char *str)
{

lcd.locate(col,row);
lcd.printf("%s",str);

}
void Clear_LCD(void)
{
    lcd.cls();   
}

void  Display_time(void)
{
       // Disable Interrupts
 while(1)
 {
// do something that can't be interrupted
       // Thread::signal_wait(0x1);
        time_t curr_time;
        tm * curr_tm;
        char date_string[10];
        char time_string[10];
        time(&curr_time);
        curr_tm = localtime(&curr_time);
        strftime(date_string, 10, "%d%b%y", curr_tm);
        strftime(time_string, 10, " %T", curr_tm);
        lcd.locate(0,1);
        lcd.printf("%s",date_string);
        lcd.printf("%s",time_string);
        wait(1);
  }
 
}