gavinlyonsrepo/Arduino_Clock_3

'RTC' was not declared in this scope

HoriMora opened this issue · 4 comments

Hi.
Here is the complete error message generated by Arduino IDE 2.1.0 when compiling clock_number_3.ino.

Please support me, how to correct this.

Many thanks!

C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void setup()':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:66:19: error: 'RTC' was not declared in this scope
setSyncProvider(RTC.get); // the function to get the time from the RTC
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void loop()':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:94:5: error: 'RTC' was not declared in this scope
RTC.alarm(ALARM_2); // reset the alarm flag
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:94:15: error: 'ALARM_2' was not declared in this scope
RTC.alarm(ALARM_2); // reset the alarm flag
^~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void SetDate(uint8_t, uint8_t)':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:253:7: error: 'RTC' was not declared in this scope
RTC.set(t); // use the time_t value to ensure correct weekday is set
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void SetAlarm()':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:278:9: error: 'RTC' was not declared in this scope
RTC.setAlarm(ALM2_MATCH_HOURS, 0, Minutes, Hours, 0);
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:278:22: error: 'ALM2_MATCH_HOURS' was not declared in this scope
RTC.setAlarm(ALM2_MATCH_HOURS, 0, Minutes, Hours, 0);
^~~~~~~~~~~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:280:19: error: 'ALARM_1' was not declared in this scope
RTC.alarm(ALARM_1);
^~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:281:19: error: 'ALARM_2' was not declared in this scope
RTC.alarm(ALARM_2);
^~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:283:24: error: 'SQWAVE_NONE' was not declared in this scope
RTC.squareWave(SQWAVE_NONE);
^~~~~~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:283:24: note: suggested alternative: 'SKIP_NONE'
RTC.squareWave(SQWAVE_NONE);
^~~~~~~~~~~
SKIP_NONE
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void Display(uint8_t)':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:361:3: error: 'RTC' was not declared in this scope
RTC.read(tm);
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void ShowAlarm()':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:405:15: error: 'RTC' was not declared in this scope
minbyte = RTC.readRTC(0x0B); //read the minute byte value from SRAM location B
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino: In function 'void ClearAlarm()':
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:442:3: error: 'RTC' was not declared in this scope
RTC.setAlarm(ALM1_MATCH_DATE, 0, 0, 0, 1);
^~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:442:16: error: 'ALM1_MATCH_DATE' was not declared in this scope
RTC.setAlarm(ALM1_MATCH_DATE, 0, 0, 0, 1);
^~~~~~~~~~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:443:16: error: 'ALM2_MATCH_DATE' was not declared in this scope
RTC.setAlarm(ALM2_MATCH_DATE, 0, 0, 0, 1);
^~~~~~~~~~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:444:13: error: 'ALARM_1' was not declared in this scope
RTC.alarm(ALARM_1);
^~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:445:13: error: 'ALARM_2' was not declared in this scope
RTC.alarm(ALARM_2);
^~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:448:18: error: 'SQWAVE_NONE' was not declared in this scope
RTC.squareWave(SQWAVE_NONE);
^~~~~~~~~~~
C:_Y_Technical_Material\Arduino_RTC_DS3231_LED_TM1638_Gavin_Lyons\clock_number_3\clock_number_3.ino:448:18: note: suggested alternative: 'SKIP_NONE'
RTC.squareWave(SQWAVE_NONE);
^~~~~~~~~~~
SKIP_NONE

exit status 1

Compilation error: 'RTC' was not declared in this scope

Hello

I developed this project ~3 years ago , The version of the DS3232RTC library by JChristensen used was 1.2.6.

In 2022 he released 2.0.0 Arduino DS3232RTC Library 2.0.0

Which as you can see from release notes in link is not backwards compatible. That is what is causing the compilation errors.

Hi

I have added a note to the readme about this issue, Closing this now.