Hello,
I want to write a library at the time from a Network Time Protocol (NTP) time servers get.
The first problem I have is the inizialieserung of the "EthernetUDP" object in my NTC_Time.h file.
#ifndef NTC_Time_h
#define NTC_Time_h
#include "Arduino.h"
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
class NTC_Time{
private:
EthernetUDP Udp;
public:
NTC_Time(byte ipNTCServer[4], byte pTimeZone); //my constructor
};
#endif
If I leave the NTC_Time.cpp empty, I get no error.
If I write something in the NTC_Time.cpp I get the following error.
#include "NTC_Time.h"
#include "Arduino.h"
NTC_Time::NTC_Time(byte ipNTCServer[4], byte pTimeZone){
}
In file included from NTC_Time.cpp:1:
NTC_Time.h:11: error: 'EthernetUDP' does not name a type
Do you have any idea what I could do to make it work?
The second problem is, I do not know how to pass IP addresses to a function / libraries.
Thanks!
PS: I am a newbie in things like libraries / classes.