DCF77 library & examples compilation problems

Hello! I am attempting to install the DCF77 library GitHub - thijse/Arduino-DCF77: Efficient and complete DCF77 library for Arduino and the InternalClockSync example on a Nano and I am getting a couple of odd errors. Here is the bit of the example code that the IDE doesn't like.

#include "DCF77.h"
#include "TimeLib.h"
//#include "Time.h"

#define DCF_PIN 2 // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0 // Interrupt number associated with pin

time_t time;

The "time_t time" statement raises the error "redeclared as different kind of symbol. This happens whether of not the Time.h library is included. I have just updated the IDE to the latest with no change in the error.

If I comment out the offending statement I just get "Error compiling for board Arduino Nano".

I'm afraid as a relative newbie I haven't a clue what the problem is here so all help gratefully received!

Thanks, John.

It seems that this library is no longer maintained.

You could try the following. Locate the files DCF77.h, DCF77.cpp and utility/Utils.h, you probably find them in the Arduino/libraries/DCF77 folder. In these files, change the line

#include <Time.h>

to

#include <TimeLib.h>

I am not sure this fixes the issue, but the sketch compiles.

Aha! Thanks for that, I had made the change in the example code but not in the libraries themselves. It does now compile.

Good to hear.

Can you please mark the most helpful post as the solution, it prevents helpers spending time on a solved issue and it will lead people with the same question to the right answer directly.

Thanks for the tip - done.

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