real time clock...Marcel Reath

Dependencies:   RTC8563 mbed

Fork of rtc_func by HIMBED_3AHELI

Committer:
MarcelReath
Date:
Wed Apr 22 18:11:09 2015 +0000
Revision:
5:22c2676c8acf
Parent:
4:f3adf7e6dd40
Marcel Reath

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bulmecisco 0:32ae5fd83722 1 /***********************************
bulmecisco 0:32ae5fd83722 2 name: main.cpp Version: 0.1
bulmecisco 0:32ae5fd83722 3 author: PE HTL BULME
bulmecisco 0:32ae5fd83722 4 email: pe@bulme.at
bulmecisco 0:32ae5fd83722 5 description:
bulmecisco 0:32ae5fd83722 6 Real Time Clock (RTC8563)
bulmecisco 0:32ae5fd83722 7 on HIMBED M0 - LPC11U24
MarcelReath 4:f3adf7e6dd40 8 class Date inherited from class RTC8563
MarcelReath 4:f3adf7e6dd40 9 Example methode GetDay implemented
MarcelReath 4:f3adf7e6dd40 10 ToDo:
MarcelReath 4:f3adf7e6dd40 11 implement year, month;
bulmecisco 0:32ae5fd83722 12 ***********************************/
bulmecisco 0:32ae5fd83722 13 #include "mbed.h"
bulmecisco 3:f75062350241 14 #include "const.h"
bulmecisco 3:f75062350241 15 #include "RTC8563.h"
bulmecisco 3:f75062350241 16 #include "string"
MarcelReath 4:f3adf7e6dd40 17 #include "Date.h"
bulmecisco 3:f75062350241 18
bulmecisco 0:32ae5fd83722 19 Serial pc(USBTX, USBRX);
bulmecisco 3:f75062350241 20
MarcelReath 4:f3adf7e6dd40 21 uint8_t year, month, day;
bulmecisco 3:f75062350241 22
bulmecisco 0:32ae5fd83722 23 int main()
bulmecisco 0:32ae5fd83722 24 {
MarcelReath 4:f3adf7e6dd40 25 Date rtc; // instanziieren des Objektes rtc
bulmecisco 3:f75062350241 26
bulmecisco 0:32ae5fd83722 27 while(1) {
MarcelReath 4:f3adf7e6dd40 28 pc.printf("____Date: %i.%i.%i\n", rtc.GetDay(),rtc.GetMonth(),rtc.GetYear());
bulmecisco 0:32ae5fd83722 29 wait(1);
bulmecisco 0:32ae5fd83722 30 }
MarcelReath 4:f3adf7e6dd40 31 }
MarcelReath 4:f3adf7e6dd40 32