I tried to run the DCF77 example and get a few errors. I'm sure the code was tested so what am I'm missing?
the code :
#include "DCF77.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;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);
void setup() {
Serial.begin(9600);
DCF.Start();
Serial.println("Waiting for DCF77 time ... ");
Serial.println("It will take at least 2 minutes until a first update can be processed.");
}
void loop() {
delay(1000);
time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available
if (DCFtime!=0)
{
Serial.println("Time is updated");
setTime(DCFtime);
}
digitalClockDisplay();
}
the first error :
Arduino: 1.5.5-r2 (Windows 7), Board: "Arduino Leonardo"
In file included from InternalClockSync.pde:13:
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:29: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:30: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:31: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:32: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:64: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:91: error: 'time_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:92: error: 'time_t' does not name a type
InternalClockSync:19: error: 'time_t' does not name a type
InternalClockSync.pde: In function 'void loop()':
InternalClockSync:32: error: 'time_t' was not declared in this scope
InternalClockSync:32: error: expected `;' before 'DCFtime'
InternalClockSync:33: error: 'DCFtime' was not declared in this scope
InternalClockSync:36: error: 'setTime' was not declared in this scope
InternalClockSync.pde: In function 'void digitalClockDisplay()':
InternalClockSync:43: error: 'hour' was not declared in this scope
InternalClockSync:44: error: 'minute' was not declared in this scope
InternalClockSync:45: error: 'second' was not declared in this scope
InternalClockSync:47: error: 'day' was not declared in this scope
InternalClockSync:49: error: 'month' was not declared in this scope
InternalClockSync:51: error: 'year' was not declared in this scope