It's a "pointer" string thing but please explain :)

const char* monthName[12] = {"January", "February", "March", "April", "May", "June", "July", 
  "August", "September", "October", "November", "December"};

const char* dayofweek[]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};

char *mon2str(uint8_t mon, char *psz, uint8_t len) {//Month to string routine
  strncpy_P(psz, monthName[mon - 1], len);
  psz[len] = '\0';
  return (psz);

char getDate(char *psz) {//"Day of Week to string" and getDate routine
  strncpy_P(psz, dayofweek[RTC.dow-1], 10);
  char szBuf[10];
  sprintf(psz, "%s, %d %s %04d ", psz, RTC.dd, mon2str(, szBuf, 9), RTC.yyyy);

Day of the week AND the Month Name is garbage to such an extent that it eventually "kills" my Nano.

I've read the C++ Reference Manual and still can't see it.

Please put an old BASIC programmer out of my misery....

Without seeing all your declarations, eg. "psz" it is impossible to say.

Sorry, Quick response, off to babysit…

char message[40];
    getDate(message); scrollText(message, zone);

ONLY call to getDate and declaration of message…

Is that enough?


If you're using strcpy_P, best make sure the source is in PROGMEM

Thanks, that's probably it.

It WAS! I needed to use the month array in another method so I moved it out of PROGMEM. :frowning:

Can't try it as I'm not at home.... Babysitting my grandkids.... :slight_smile:

You are right AWOL - removing the _P fixed it!

Thanks :smiley: