Uno R4 minima swRTC problem

Hi. I'm trying to make a data logger using SD card.
I want to make logger that shows sensor data and time stamps.
For that, I found that it requires swRTC library to record time.
So I downloaded it and tried its sample code, but it didn't work.

I received these error messages:

In file included from C:\Users\AppData\Local\Temp.arduinoIDE-unsaved202385-26756-rh0pup.w2cdr\sketch_sep5b\sketch_sep5b.ino:1:0:
C:\Users\OneDrive\����\Arduino\libraries\swRTC/swRTC.h:62:2: error: #error Sorry, microcontroller not supported!
#error Sorry, microcontroller not supported!
^~~~~
C:\Users\OneDrive\����\Arduino\libraries\swRTC/swRTC.h:75:2: error: #error Sorry, clock frequency not supported!
#error Sorry, clock frequency not supported!
^~~~~

exit status 1

Compilation error: exit status 1

and the code is:

swRTC rtc;

void setup() {
  rtc.stopRTC();        
  rtc.setDate(9, 9, 2023); 
  rtc.setTime(0, 0, 0);  
  rtc.startRTC();           
  Serial.begin(9600);
}

void loop() {
  Serial.print(rtc.getHours(), DEC);
  Serial.print(":");
  Serial.print(rtc.getMinutes(), DEC);
  Serial.print(":");
  Serial.print(rtc.getSeconds(), DEC);
  Serial.print("\t"); 

  Serial.print(rtc.getYear(), DEC);
  Serial.print("/");
  Serial.print(rtc.getMonth(), DEC);
  Serial.print("/");
  Serial.println(rtc.getDay(), DEC);
  delay(1000);
}

I'm very new to arduino and I can't figure out why it didn't work and how to make this right.
My board is Uno R4 Minima.

Thanks.

Welcome to the forum

From the swRTC library GitHub page

swRTC is a library that implements a software-RTC on an Arduino board or an Atmel microcontroller

As indicated by the error message, your board does not have the required microcontroller

What features of the library were you hoping to use ? Have you considered using a real RTC ?

1 Like

I only want some timestamps as: 00:00:01, 00:00:02 ... It doesn't matter if it's not a real RTC.
Does it need additional module?

The R4 Minima has a built in RTC. You don't need an external one nor a software derived one.

1 Like

It works!!!!! I didn't know there was a tutorial. Thanks!!!

Please mark as a solution if it helped to let people know the thread is done.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.