i have a problem about RTC

void SaveRTC()
{
  int year=rtcSet[6] - 2000;
      
  RTC.stop();            //RTC clock setup 
  RTC.setsecond(DS1307_SEC,1);
  RTC.set(DS1307_MIN,rtcSet[1]);
  RTC.set(DS1307_HR,rtcSet[2]);
  //RTC.set(DS1307_DOW,1);
  RTC.set(DS1307_DATE,rtcSet[4]);
  RTC.set(DS1307_MTH,rtcSet[5]);
  RTC.set(DS1307_YR,year);
  delay(10);
  RTC.start();
  delay(10);
  for(int i=0; i<56; i++)
    { RTC.set_sram_byte(65,i);   } 
  delay(50);

error:

C:\Users\FURKAN 10\Desktop\hydroponic control\lcd_touch_control\lcd_touch_control.ino: In function 'void SaveRTC()':

lcd_touch_control:623: error: 'RTC' was not declared in this scope

   RTC.stop();            //RTC clock setup 

   ^

lcd_touch_control:624: error: 'DS1307_SEC' was not declared in this scope

   RTC.set(DS1307_SEC,1);

           ^

lcd_touch_control:625: error: 'DS1307_MIN' was not declared in this scope

   RTC.set(DS1307_MIN,rtcSet[1]);

           ^

lcd_touch_control:626: error: 'DS1307_HR' was not declared in this scope

   RTC.set(DS1307_HR,rtcSet[2]);

           ^

lcd_touch_control:628: error: 'DS1307_DATE' was not declared in this scope

   RTC.set(DS1307_DATE,rtcSet[4]);

           ^

lcd_touch_control:629: error: 'DS1307_MTH' was not declared in this scope

   RTC.set(DS1307_MTH,rtcSet[5]);

           ^

lcd_touch_control:630: error: 'DS1307_YR' was not declared in this scope

   RTC.set(DS1307_YR,year);

What RTC library? Where's the rest of the code? What are we supposed to be able to tell from just that one little snippet.

I use these library

#include <UTFT.h>
#include <avr/pgmspace.h>
#include <URTouch.h>
#include <Wire.h>
#include <EEPROM.h>
#include "writeAnything.h"
#include <DS1307.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <DHT22.h>

and I installed libraries " C: Program Files(86x)/ Arduino/ Libraries

Take your snippets here and they can probably help you. When you decide you want to fix this come back and post a complete program that will compile and exhibits the issue and we can try to help.

Why you answer only one of my questions and ignore the other two?

See reply #1. "Where's the rest of the code?"

sorry sir. The code is 4000 line. i tried that but the message allow 9999 character

furkan44:
sorry sir. The code is 4000 line. i tried that but the message allow 9999 character

You can add it as an attachment.

Was there a time when you had, for example, 3500 lines and you didn't have this problem? What was the last change you made before it happened? :slight_smile:

There are 3 files

aa.ino (836 Bytes)

lcd_touch_control.ino (141 KB)

writeAnything.h (417 Bytes)

And what about the answer to his question? You'll find that if you keep ignoring the questions you are being asked that pretty quickly we will just start ignoring your thread.

How did your program get so big without any debugging? Did you not try to compile all the smaller bits by themselves?

I don't see where you tried to create any RTC object. Look at the examples for the RTC library you have and see how they handle that.

I was founded this code on Internet. (I dont remember link but the code can be post this site)
I think the coders modified from Jarduino v1.2

Try

#include <RTClib.h>

instead of

#include "RTClib.h"