RTC

Dependents:   GloboMet GloboMetereologico MPSMAX_copy

Files at this revision

API Documentation at this revision

Comitter:
DanielOlarte
Date:
Sat Nov 19 18:46:24 2016 +0000
Commit message:
RTC

Changed in this revision

RTC.cpp Show annotated file Show diff for this revision Revisions of this file
RTC.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 86951afbcc3f RTC.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RTC.cpp	Sat Nov 19 18:46:24 2016 +0000
@@ -0,0 +1,21 @@
+#include "RTC.h"
+
+int tiempo;
+
+int RealTime::setdatetime(int hour, int min, int day, int mon, int year)
+
+{
+    struct tm t;
+    t.tm_sec=00;
+    t.tm_min=min;
+    t.tm_hour=hour;
+    t.tm_mday=day;
+    t.tm_mon=mon-1;
+    t.tm_year=year+100;
+    time_t seconds =mktime(&t);
+    tiempo=mktime(&t);
+    return tiempo;
+    wait (1);
+
+}
+
diff -r 000000000000 -r 86951afbcc3f RTC.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RTC.h	Sat Nov 19 18:46:24 2016 +0000
@@ -0,0 +1,17 @@
+#ifndef MBED_RTC
+#define MBED_RTC_H
+
+#include "mbed.h"
+
+using namespace mbed;
+
+class RealTime
+
+{
+public:
+
+    int setdatetime(int, int , int, int, int);
+    
+};
+
+#endif
\ No newline at end of file