Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to DateTime::dayOfTheWeek() #91

Open
Danccce opened this issue Sep 16, 2023 · 3 comments
Open

undefined reference to DateTime::dayOfTheWeek() #91

Danccce opened this issue Sep 16, 2023 · 3 comments

Comments

@Danccce
Copy link

Danccce commented Sep 16, 2023

Hi everybody,

I'm using the DS3231 module and tried to modify the "now" example code:

void loop () {
    
    delay(1000);
    
    DateTime now = myRTC.now();
    
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
    **Serial.print(now.dayOfTheWeek(), DEC);
    Serial.println();** 

but I got the error message
.../now/now.ino:37: undefined reference to DateTime::dayOfTheWeek() const`

what am I doing wrong? I use Arduno IDE 2.2.1 and DS33231 lib 1.1.2

Thank you
Marc

@hasenradball
Copy link
Contributor

hasenradball commented Oct 17, 2023

@Danccce @IowaDave ,

I would say the DateTime Class has a declaration of the dayOfTheWeek() function, but the function is not defined.
We need to define this function.
Or delete the declaration.

@hasenradball
Copy link
Contributor

hasenradball commented Oct 18, 2023

@Danccce @IowaDave
I prepared an solution.
Tested on ESP8266
See PR #95

@hasenradball
Copy link
Contributor

@Danccce for this Issue you can try this library DS3231-RTC.
It is also available in Arduino now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants