Johannes Mayerhofer
/
rtc_class2
Original programm
Fork of rtc_class by
main.cpp@8:54a6f83a2339, 2015-04-23 (annotated)
- Committer:
- bulmecisco
- Date:
- Thu Apr 23 10:43:38 2015 +0000
- Revision:
- 8:54a6f83a2339
- Parent:
- 6:ebe2350041f1
- Child:
- 9:83be0e4edb52
5. Ueberladene Methoden in Klasse Date und using::GetDay in Klasse Datestring
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bulmecisco | 0:32ae5fd83722 | 1 | /*********************************** |
bulmecisco | 6:ebe2350041f1 | 2 | name: main.cpp Version: 0.3 |
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 |
bulmecisco | 3:c6081814064d | 8 | class Date inherited from class RTC8563 |
bulmecisco | 3:c6081814064d | 9 | Example methode GetDay implemented |
bulmecisco | 3:c6081814064d | 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" |
bulmecisco | 6:ebe2350041f1 | 18 | #include "DateString.h" |
bulmecisco | 6:ebe2350041f1 | 19 | |
bulmecisco | 0:32ae5fd83722 | 20 | Serial pc(USBTX, USBRX); |
bulmecisco | 2:f75062350241 | 21 | |
bulmecisco | 3:c6081814064d | 22 | uint8_t year, month, day; |
bulmecisco | 3:c6081814064d | 23 | |
bulmecisco | 0:32ae5fd83722 | 24 | int main() |
bulmecisco | 0:32ae5fd83722 | 25 | { |
bulmecisco | 6:ebe2350041f1 | 26 | DateString rtc; // instanziieren des Objektes rtc |
bulmecisco | 2:f75062350241 | 27 | |
bulmecisco | 0:32ae5fd83722 | 28 | while(1) { |
bulmecisco | 8:54a6f83a2339 | 29 | pc.printf("DateString.Day: %i\n", rtc.GetDay()); |
bulmecisco | 8:54a6f83a2339 | 30 | pc.printf("DateString.NextDay: %i\n", rtc.GetNextDay()); |
bulmecisco | 8:54a6f83a2339 | 31 | pc.printf("Ueberladen GetDay: %s\n", rtc.GetDay("Where am I?")); |
bulmecisco | 0:32ae5fd83722 | 32 | wait(1); |
bulmecisco | 0:32ae5fd83722 | 33 | } |
bulmecisco | 8:54a6f83a2339 | 34 | } |
bulmecisco | 8:54a6f83a2339 | 35 | |
bulmecisco | 8:54a6f83a2339 | 36 | |
bulmecisco | 8:54a6f83a2339 | 37 | |
bulmecisco | 8:54a6f83a2339 | 38 | |
bulmecisco | 8:54a6f83a2339 | 39 |