![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
rtc_class
Fork of rtc_class by
Diff: Date.cpp
- Revision:
- 10:83960ae8a0ee
- Parent:
- 5:fc8c66a7c87a
diff -r fc8c66a7c87a -r 83960ae8a0ee Date.cpp --- a/Date.cpp Thu Apr 23 09:02:20 2015 +0000 +++ b/Date.cpp Thu Apr 30 10:48:18 2015 +0000 @@ -3,10 +3,10 @@ author: PE HTL BULME email: pe@bulme.at description: - Real Time Clock (RTC8563) on HIMBED M0 - LPC11U24 + Real Time Clock (RTC8563) on HIMBED M0 - LPC11U24 class Date inherited from class RTC8563 - Example methode GetDay implemented -ToDo: + Example methode GetDay implemented +ToDo: implement GetYear, GetMonth; Constructor to initialize Date on RTC Alarm methode @@ -29,10 +29,21 @@ char buffer[2]; sprintf (buffer, "%d", value); // ToString() return buffer; -} +} uint8_t Date::GetDay() { uint8_t day = rtc_read(DAYS); return bcdToUint(day & 0x3F); +} + +uint8_t Date::GetDay(int value) +{ + return value; +} + +string Date::GetDay(string str) +{ + string day= str + " In Date Day: " + toString(GetDay()); + return day; } \ No newline at end of file