Go Down

Topic: DCF77 library for Arduino - synchronize with atomic clock (Read 40867 times) previous topic - next topic

babutian

Hello after downloading the DCF77 lib (including Time and TimeZone) I keep getting the following errors:

Code: [Select]


Build options changed, rebuilding all
\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::finalizeBuffer()':

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:160:25: error: 'now' was not declared in this scope

   filledTimestamp = now();

                         ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::receivedTimeUpdate()':

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:189:50: error: 'now' was not declared in this scope

  time_t processedTime = latestupdatedTime + (now() - processingTimestamp);

                                                  ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:197:20: error: 'SECS_PER_MIN' was not declared in this scope

  if(difference < 2*SECS_PER_MIN) {

                    ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:209:25: error: 'SECS_PER_MIN' was not declared in this scope

  if(shiftDifference < 2*SECS_PER_MIN) {

                         ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::processBuffer()':

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:271:2: error: 'tmElements_t' was not declared in this scope

  tmElements_t time;

  ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:284:12: error: request for member 'Second' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

       time.Second = 0;

            ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:285:9: error: request for member 'Minute' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

    time.Minute = rx_buffer->Min-((rx_buffer->Min/16)*6);

         ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:286:12: error: request for member 'Hour' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

       time.Hour   = rx_buffer->Hour-((rx_buffer->Hour/16)*6);

            ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:287:12: error: request for member 'Day' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

       time.Day    = rx_buffer->Day-((rx_buffer->Day/16)*6);

            ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:288:12: error: request for member 'Month' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

       time.Month  = rx_buffer->Month-((rx_buffer->Month/16)*6);

            ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:289:12: error: request for member 'Year' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'

       time.Year   = 2000 + rx_buffer->Year-((rx_buffer->Year/16)*6) -1970;

            ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:290:37: error: 'makeTime' was not declared in this scope

    latestupdatedTime = makeTime(time); 

                                     ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getTime()':

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:310:48: error: 'now' was not declared in this scope

   time_t currentTime =latestupdatedTime + (now() - processingTimestamp);

                                                ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getUTCTime()':

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:325:42: error: 'SECS_PER_HOUR' was not declared in this scope

   int UTCTimeDifference = (CEST ? 2 : 1)*SECS_PER_HOUR;

                                          ^

\\nas\Main\DOCUMENTS\Arduino\libraries\DCF77\DCF77.cpp:326:68: error: 'now' was not declared in this scope

   time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp);

                                                                    ^

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.



for just this code:

Code: [Select]
#include "DCF77.h"
#include "Time.h"

 
char time_s[9];
char date_s[11];
 
#define DCF_PIN 2           // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0    // Interrupt number associated with pin
 
time_t t;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);
 
void setup() {
  Serial.begin(9600);
  DCF.Start();
  Serial.println("Warte auf Zeitsignal ... ");
  Serial.println("Dies kann 2 oder mehr Minuten dauern.");
}
 
void loop() {

}
 


Any suggestions would be greatly appreciated!

6v6gt

Try:
#include <TimeLib.h>
Instead of:
#include "Time.h"

babutian

Hi, unfortunately I don't have the timeLib.h file, there is only time.h in the appropriate Time lib folder... Where do I get it?

regards


Go Up