Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of rtc_func by
Revision 3:75f5352b387d, committed 2015-04-30
- Comitter:
- KagerJ
- Date:
- Thu Apr 30 10:53:00 2015 +0000
- Parent:
- 2:ce174a86d215
- Commit message:
- added GetDay() GetYear() GetWeek()
Changed in this revision
--- a/Date.cpp Thu Apr 23 09:42:34 2015 +0000 +++ b/Date.cpp Thu Apr 30 10:53:00 2015 +0000 @@ -25,7 +25,7 @@ uint8_t year = rtc_read(YEARS); return bcdToUint(year & 0x3F); } -uint8_t Date::GetWEEK() +uint8_t Date::GetWeek() { uint8_t week = rtc_read(WEEKDAYS); return bcdToUint(week & 0x07);
--- a/Date.h Thu Apr 23 09:42:34 2015 +0000 +++ b/Date.h Thu Apr 30 10:53:00 2015 +0000 @@ -12,6 +12,7 @@ uint8_t GetDay(); uint8_t GetMonth(); uint8_t GetYear(); + uint8_t GetWeek(); }; #endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DateString.cpp Thu Apr 30 10:53:00 2015 +0000 @@ -0,0 +1,11 @@ +#include "DateString.h" +#include "RTC8563.h" + +//2. Methode überschreiben +uint8_t DateSting::GetDay() +{ + uint8_t day= Date::GetDay(); //Aufruf der GetDay- Methode aus Basisklasse Date mit Scope Operator + //Erweitern von Methoden der Basisklasse + day = day - 5; + return day; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DateString.h Thu Apr 30 10:53:00 2015 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" +#include "const.h" +#include "RTC8563.h" +#include "string" +#include "Date.h" + +#ifndef DATESTRING_H +#define DATESTRRING_H + +class DateString : public Date +{ + public: + uint8_t GetDay(); +}; + +#endif \ No newline at end of file
--- a/main.cpp Thu Apr 23 09:42:34 2015 +0000 +++ b/main.cpp Thu Apr 30 10:53:00 2015 +0000 @@ -3,6 +3,7 @@ #include "RTC8563.h" #include "string" #include "Date.h" +#include "DateString.h" Serial pc(USBTX, USBRX); //I2C i2c(p28, p27);