Andrew Duda / Mbed 2 deprecated MbedClock

Dependencies:   4DGL-uLCD-SE EthernetInterface NTPClient mbed-rtos mbed SDFileSystem wavfile

Clock.h

Committer:
dudanian
Date:
2014-12-02
Revision:
0:4e6ae21cbd31
Child:
2:c939d0501184

File content as of revision 0:4e6ae21cbd31:

#include "mbed.h"
#include "NTPClient.h"

// AM/PM
const int AM = 0;
const int PM = 12;

// Timezones
const int PST = -8;
const int MST = -7;
const int CST = -6;
const int EST = -5;
const int UTC = 0;

class Clock {
public:
    Clock();
    
    void setTime(int hour, int minute, int period);
    void setTimezone(int timezone);
    
    int syncTime();
    
    time_t getTime();
    int getTimezone();
private:
    int timezone;    
    
    static bool isSet;
};