RTC

Dependents:   GloboMet GloboMetereologico MPSMAX_copy

Committer:
DanielOlarte
Date:
Sat Nov 19 18:46:24 2016 +0000
Revision:
0:86951afbcc3f
RTC

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DanielOlarte 0:86951afbcc3f 1 #include "RTC.h"
DanielOlarte 0:86951afbcc3f 2
DanielOlarte 0:86951afbcc3f 3 int tiempo;
DanielOlarte 0:86951afbcc3f 4
DanielOlarte 0:86951afbcc3f 5 int RealTime::setdatetime(int hour, int min, int day, int mon, int year)
DanielOlarte 0:86951afbcc3f 6
DanielOlarte 0:86951afbcc3f 7 {
DanielOlarte 0:86951afbcc3f 8 struct tm t;
DanielOlarte 0:86951afbcc3f 9 t.tm_sec=00;
DanielOlarte 0:86951afbcc3f 10 t.tm_min=min;
DanielOlarte 0:86951afbcc3f 11 t.tm_hour=hour;
DanielOlarte 0:86951afbcc3f 12 t.tm_mday=day;
DanielOlarte 0:86951afbcc3f 13 t.tm_mon=mon-1;
DanielOlarte 0:86951afbcc3f 14 t.tm_year=year+100;
DanielOlarte 0:86951afbcc3f 15 time_t seconds =mktime(&t);
DanielOlarte 0:86951afbcc3f 16 tiempo=mktime(&t);
DanielOlarte 0:86951afbcc3f 17 return tiempo;
DanielOlarte 0:86951afbcc3f 18 wait (1);
DanielOlarte 0:86951afbcc3f 19
DanielOlarte 0:86951afbcc3f 20 }
DanielOlarte 0:86951afbcc3f 21