![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
rtc_class2
Fork of rtc_class by
main.cpp@6:83960ae8a0ee, 2015-04-30 (annotated)
- Committer:
- wolpra98
- Date:
- Thu Apr 30 10:48:18 2015 +0000
- Revision:
- 6:83960ae8a0ee
- Parent:
- 5:fc8c66a7c87a
rtc_class;
Who changed what in which revision?
User | Revision | Line number | New 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: |
wolpra98 | 6:83960ae8a0ee | 6 | Real Time Clock (RTC8563) |
wolpra98 | 6:83960ae8a0ee | 7 | on HIMBED M0 - LPC11U24 |
bulmecisco | 3:c6081814064d | 8 | class Date inherited from class RTC8563 |
wolpra98 | 6:83960ae8a0ee | 9 | Example methode GetDay implemented |
wolpra98 | 6:83960ae8a0ee | 10 | ToDo: |
bulmecisco | 3:c6081814064d | 11 | implement year, month; |
bulmecisco | 0:32ae5fd83722 | 12 | ***********************************/ |
bulmecisco | 0:32ae5fd83722 | 13 | #include "mbed.h" |
bulmecisco | 2:f75062350241 | 14 | #include "const.h" |
bulmecisco | 2:f75062350241 | 15 | #include "RTC8563.h" |
bulmecisco | 2:f75062350241 | 16 | #include "string" |
bulmecisco | 3:c6081814064d | 17 | #include "Date.h" |
wolpra98 | 6:83960ae8a0ee | 18 | #include "DateString.h" |
wolpra98 | 6:83960ae8a0ee | 19 | |
bulmecisco | 0:32ae5fd83722 | 20 | Serial pc(USBTX, USBRX); |
wolpra98 | 6:83960ae8a0ee | 21 | |
bulmecisco | 3:c6081814064d | 22 | uint8_t year, month, day; |
bulmecisco | 3:c6081814064d | 23 | |
bulmecisco | 0:32ae5fd83722 | 24 | int main() |
bulmecisco | 0:32ae5fd83722 | 25 | { |
wolpra98 | 6:83960ae8a0ee | 26 | Date *pBoth; |
wolpra98 | 6:83960ae8a0ee | 27 | DateString ds; // instanziieren des Objektes rtc |
wolpra98 | 6:83960ae8a0ee | 28 | Date d; |
wolpra98 | 6:83960ae8a0ee | 29 | |
bulmecisco | 0:32ae5fd83722 | 30 | while(1) { |
wolpra98 | 6:83960ae8a0ee | 31 | pBoth = &d; |
wolpra98 | 6:83960ae8a0ee | 32 | pc.printf("DateString.Day: %i\n", pBoth->GetDay()); |
wolpra98 | 6:83960ae8a0ee | 33 | pc.printf("Ueberladen Day: %s\n", pBoth->GetDay("where am I?")); |
wolpra98 | 6:83960ae8a0ee | 34 | pBoth=&ds |
wolpra98 | 6:83960ae8a0ee | 35 | pc.printf("DateString.NextDay: %i\n", pBoth->GetNextDay()); |
wolpra98 | 6:83960ae8a0ee | 36 | pc.printf("Ueberladen Day: %s\n", pBoth->GetDay("where am I?")); |
bulmecisco | 0:32ae5fd83722 | 37 | wait(1); |
bulmecisco | 0:32ae5fd83722 | 38 | } |
bulmecisco | 2:f75062350241 | 39 | } |