How do I display and set time/date on my lcd?

How do I use “Grove-RTC, SEN12671P” to display current time and date on the LCD, and also having another option to SET time and date?
I actually wanted to use push button or rotary encoder. But I just can’t seem to come out with a code to display it on my LCD.
Please help me…
Thankyou in advance(;

The Grove-RTC, SEN12671P is based on the DS1307 RTC, and how you communicate with it will depend upon the library you choose to use.

I would recommend either

  1. The DS1307RTC library here http://www.pjrc.com/teensy/td_libs_DS1307RTC.html which will require the use of the Time library available here http://www.pjrc.com/teensy/td_libs_Time.htmlLibrary

or

  1. RTCLIB available here GitHub - adafruit/RTClib: A fork of Jeelab's fantastic RTC library

Both libraries come with examples of how to read and set the RTC.

The DS1307 is a common RTC and there is much material available on line. Here is one tutorial

As AWOL said get yourself started and post some code.

Hi all!

I managed to get it display on my LCD, but now the problem is that I would like to use a rotary encoder to set my time on my lcd. Any idea how to input my rotary encoder with the set time function available?
Below is the code to show the RTC on the LCD

Thanks for all of y’all help!!! :* :* :* :slight_smile: :slight_smile: :slight_smile:

/****************************************************************************/	
//	Function: Set time and get the time from RTC chip(DS1307) and display 
//			  it on the serial monitor.
//	Hardware: Grove - RTC
//	Arduino IDE: Arduino-1.0
//	Author:	 FrankieChu		
//	Date: 	 Jan 19,2013
//	Version: v1.0
//	by www.seeedstudio.com
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2.1 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
/****************************************************************************/
#include <Wire.h>
#include "DS1307.h"

DS1307 clock;//define a object of DS1307 class
void setup()
{
	Serial.begin(9600);
	clock.begin();
	clock.fillByYMD(2013,1,19);//Jan 19,2013
	clock.fillByHMS(15,28,30);//15:28 30"
	clock.fillDayOfWeek(SAT);//Saturday
	clock.setTime();//write time to the RTC chip
}
void loop()
{
	printTime();
}
/*Function: Display time on the serial monitor*/
void printTime()
{
	clock.getTime();
	Serial.print(clock.hour, DEC);
	Serial.print(":");
	Serial.print(clock.minute, DEC);
	Serial.print(":");
	Serial.print(clock.second, DEC);
	Serial.print("	");
	Serial.print(clock.month, DEC);
	Serial.print("/");
	Serial.print(clock.dayOfMonth, DEC);
	Serial.print("/");
	Serial.print(clock.year+2000, DEC);
	Serial.print(" ");
	Serial.print(clock.dayOfMonth);
	Serial.print("*");
	switch (clock.dayOfWeek)// Friendly printout the weekday
	{
		case MON:
		  Serial.print("MON");
		  break;
		case TUE:
		  Serial.print("TUE");
		  break;
		case WED:
		  Serial.print("WED");
		  break;
		case THU:
		  Serial.print("THU");
		  break;
		case FRI:
		  Serial.print("FRI");
		  break;
		case SAT:
		  Serial.print("SAT");
		  break;
		case SUN:
		  Serial.print("SUN");
		  break;
	}
	Serial.println(" ");
}

Below is the code to show the RTC on the LCD

You have not done that. You have just copied and pasted(good job using the code tags) an example from the library you are using to display the time on a serial monitor. You show no code that you have written to write to the LCD, or handle the format issues related to the LCD. People on this forum will help you work through problems, but they will not write your code or do all your work for you.

Any idea how to input my rotary encoder with the set time function available?

I have no clue with the information you have provided so far. You will have to provide documentation on the rotary encoder you have.

What ideas to do you have for using the rotary encoder?

As stated before, get yourself started and post some code that you have written.