RTC clock with days of week

I have a RTC clock working with time hh:mm:ss and dd/mm/yyyy

In the sketch the display should say sunday, monday etc. This part of the code does not work/is not accepted int dayofweek = now.dayOfWeek();

switch(dayofweek){ case 1: lcd.print("Monday"); break; case 2: lcd.print("Tuesday"); break; case 3: lcd.print("Wednesday"); break; case 4: lcd.print("Thursday"); break; case 5: lcd.print("Friday"); break; case 6: lcd.print("Saturday"); break; case 0: lcd.print("Sunday");

break;} //

Ik krijg foutmelding Arduino: 1.6.13 (Windows 10), Board:"Arduino/Genuino Uno"

C:\Users\spaan\Documents\Arduino\probeerklokkiewerkt\probeerklokkiewerkt.ino: In function 'void loop()':

probeerklokkiewerkt:50: error: 'class DateTime' has no member named 'dayOfWeek'

int dayofweek = now.dayOfWeek();

^

exit status 1 'class DateTime' has no member named 'dayOfWeek'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Hoe krijg ik dit werkend

'class DateTime' has no member named 'dayOfWeek'The problem seems very clear. Have you got any documentation for the library that you are using ? Where did you get it from ? Look in the library .h and .cpp files to see which functions are available.

http://bildr.org/2011/03/ds1307-arduino/

Here’s something I dug up:

int weekday(int year, int month, int day)
/* Calculate day of week in proleptic Gregorian calendar. Sunday == 0. */
{
  int adjustment, mm, yy;
  if (year<2000) year+=2000;
  adjustment = (14 - month) / 12;
  mm = month + 12 * adjustment - 2;
  yy = year - adjustment;
  return (day + (13 * mm - 1) / 5 +
    yy + yy / 4 - yy / 100 + yy / 400) % 7;
}

I believe that this was written by jurs.

This function numbers the days of the week from 0 to 6, with 0 meaning Sunday. If you want a different numbering, you will need to adjust for it.

Maybe this can help.

void updateDOWDisplay()
{
  RtcDateTime currentDate = rtcObject.GetDateTime();  //get the time from the RTC
  int dow = currentDate.DayOfWeek();                  // Get the day of week nr right now and store them in an integer called dow
  lcd.setCursor(1, 1);                                // Move the cursor to column zero, lower row
  switch(dow){
     case 1:
     lcd.print("Mon");
     break;
     case 2:
     lcd.print("Tue");
     break;
     case 3:
     lcd.print("Wed");
     break;
     case 4:
     lcd.print("Thu");
     break;
     case 5:
     lcd.print("Fri");
     break;
     case 6:
     lcd.print("Sat");
     break;
     case 0:
     lcd.print("Sun");
     
     break;}
}

spaansebrabander: I have a RTC clock working with time hh:mm:ss and dd/mm/yyyy

In the sketch the display should say sunday, monday etc. This part of the code does not work/is not accepted int dayofweek = now.dayOfWeek();

switch(dayofweek){ case 1: lcd.print("Monday"); break; case 2: lcd.print("Tuesday"); break; case 3: lcd.print("Wednesday"); break; case 4: lcd.print("Thursday"); break; case 5: lcd.print("Friday"); break; case 6: lcd.print("Saturday"); break; case 0: lcd.print("Sunday");

break;} //

Ik krijg foutmelding Arduino: 1.6.13 (Windows 10), Board:"Arduino/Genuino Uno"

C:\Users\spaan\Documents\Arduino\probeerklokkiewerkt\probeerklokkiewerkt.ino: In function 'void loop()':

probeerklokkiewerkt:50: error: 'class DateTime' has no member named 'dayOfWeek'

int dayofweek = now.dayOfWeek();

^

exit status 1 'class DateTime' has no member named 'dayOfWeek'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Hoe krijg ik dit werkend

that is very clear, but well, try case 1: draw_text(40, 0, " SATURDAY ", 1); break; case 2: draw_text(40, 0, " SUNDAY ", 1); break; case 3: draw_text(40, 0, " MONDAY ", 1); break; case 4: draw_text(40, 0, "TUESDAY", 1); break; case 5: draw_text(40, 0, "WEDNESDAY ", 1); break; case 6: draw_text(40, 0, " THURSDAY ", 1); break; default: draw_text(40, 0, "FRIDAY ", 1); if it doesn't work, please do not PM me

Is this "revive an old thread" day ?