Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CW_copy by
print_LCD.h
- Committer:
- joseph_adamu
- Date:
- 2018-01-10
- Revision:
- 1:dc648c5624b9
File content as of revision 1:dc648c5624b9:
#include "mbed.h"
int d = 0,dd = 0,m = 0,mm = 0,y = 0,yy = 0,yyy = 0,yyyy = 0, cursor = 0, h = 0, hh = 0, mi = 0, mmi = 0, s = 0, ss = 0;
TextLCD lcd(D9, D8, D7, D6, D4, D2, TextLCD::LCD16x2); // RS, E, DB4, DB5, DB6, DB7
//********Function to display ***********************
// h/hh/mi/mni/s/ss
// h=> first integer value of the Hour
// hh=> second integer value of the Hour
// mi=> first integer value of the Minutes
// mni=> second integer value of the Minutes
// s=> first integer value of the Seconds
// ss => second integer value of the Seconds
void dis_time()
{
lcd.locate(0,1);
lcd.printf("%i", h);
lcd.locate(1,1);
lcd.printf("%i", hh);
lcd.locate(2,1);
lcd.printf(":");
lcd.locate(3,1);
lcd.printf("%i", mi);
lcd.locate(4,1);
lcd.printf("%i", mmi);
lcd.locate(5,1);
lcd.printf(":");
lcd.locate(6,1);
lcd.printf("%i", s);
lcd.locate(7,1);
lcd.printf("%i", ss);
}
//************* displaying the dates to the allocated position on the lcd *****************
// d/dd/m/mm/y/yy/yyy/yyyy
// d=> first integer value of the Day
// dd=> second integer value of the Day
// m=> first integer value of the Month
// mm=> second integer value of the Month
// y=> first integer value of the Year
// yy => second integer value of the Year
// yyy => third integer value of the Year
// yyyy => fourth integer value of the Year
void dis_dates()
{
lcd.locate(0,0);
lcd.printf("%i", d);
lcd.locate(1,0);
lcd.printf("%i", dd);
lcd.locate(2,0);
lcd.printf(":");
lcd.locate(3,0);
lcd.printf("%i", m);
lcd.locate(4,0);
lcd.printf("%i", mm);
lcd.locate(5,0);
lcd.printf(":");
lcd.locate(6,0);
lcd.printf("%i", y);
lcd.locate(7,0);
lcd.printf("%i", yy);
lcd.locate(8,0);
lcd.printf("%i", yyy);
lcd.locate(9,0);
lcd.printf("%i", yyyy);
}
//******** function holding the displaying of the date and time *****************
void displaying_date_and_time()
{
dis_time();
dis_dates();
}
