PacificThunder:
Okay well here is the issue:I'm working on an irrigation project, that includes RTC, Relay, LCD, Keypad, Bermad Water Taps, and an Arudino Mega 2560 R3.
I pasted all my code that I wrote in here.
I'll add my code as a file.
For whoever is asking from where I'm getting my hour:DS1302 has on its own library a set time code, which I use to set the time.
full_prj.rar - Google Drive
this is my full project as a RAR folder.
Here is the only funcation that gets time from RTC and displays it:
void ds_time () {
Time t = rtc.time();
lcd.setCursor (6, 0);
lcd.print (t.date);
lcd.print("/");
lcd.print (t.mon);
lcd.print ("/");
lcd.print (t.yr);
lcd.setCursor (8, 1);
lcd.print("****");
lcd.setCursor (6, 2);
lcd.print(t.hr);
lcd.print(':');
if (t.min < 10) {
lcd.print ("0" + String(t.min));
}
else
{
lcd.print(t.min);
}
lcd.print(':');
if (t.sec < 10)
{
lcd.print ( "0" + String(t.sec));
}
else {
lcd.print(t.sec, DEC);
}
lcd.setCursor (4, 4);
lcd.print("Press Any Key");
}