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.
main.cpp@1:0683aab6b134, 2015-04-30 (annotated)
- Committer:
- matthiaskosch
- Date:
- Thu Apr 30 10:49:58 2015 +0000
- Revision:
- 1:0683aab6b134
- Parent:
- 0:b65c5f2413b0
123
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| matthiaskosch | 0:b65c5f2413b0 | 1 | /*********************************** |
| matthiaskosch | 0:b65c5f2413b0 | 2 | name: main.cpp Version: 0.1 |
| matthiaskosch | 0:b65c5f2413b0 | 3 | author: PE HTL BULME |
| matthiaskosch | 0:b65c5f2413b0 | 4 | email: pe@bulme.at |
| matthiaskosch | 0:b65c5f2413b0 | 5 | description: |
| matthiaskosch | 0:b65c5f2413b0 | 6 | Real Time Clock (RTC8563) |
| matthiaskosch | 0:b65c5f2413b0 | 7 | on HIMBED M0 - LPC11U24 |
| matthiaskosch | 0:b65c5f2413b0 | 8 | class Date inherited from class RTC8563 |
| matthiaskosch | 0:b65c5f2413b0 | 9 | Example methode GetDay implemented |
| matthiaskosch | 0:b65c5f2413b0 | 10 | ToDo: |
| matthiaskosch | 0:b65c5f2413b0 | 11 | implement year, month; |
| matthiaskosch | 0:b65c5f2413b0 | 12 | ***********************************/ |
| matthiaskosch | 0:b65c5f2413b0 | 13 | #include "mbed.h" |
| matthiaskosch | 0:b65c5f2413b0 | 14 | #include "const.h" |
| matthiaskosch | 0:b65c5f2413b0 | 15 | #include "RTC8563.h" |
| matthiaskosch | 0:b65c5f2413b0 | 16 | #include "string" |
| matthiaskosch | 0:b65c5f2413b0 | 17 | #include "Date.h" |
| matthiaskosch | 0:b65c5f2413b0 | 18 | #include "DateString.h" |
| matthiaskosch | 0:b65c5f2413b0 | 19 | |
| matthiaskosch | 0:b65c5f2413b0 | 20 | Serial pc(USBTX, USBRX); |
| matthiaskosch | 0:b65c5f2413b0 | 21 | |
| matthiaskosch | 0:b65c5f2413b0 | 22 | uint8_t year, month, day; |
| matthiaskosch | 0:b65c5f2413b0 | 23 | |
| matthiaskosch | 0:b65c5f2413b0 | 24 | int main() |
| matthiaskosch | 0:b65c5f2413b0 | 25 | { |
| matthiaskosch | 0:b65c5f2413b0 | 26 | Date *pBoth; |
| matthiaskosch | 0:b65c5f2413b0 | 27 | DateString ds; |
| matthiaskosch | 0:b65c5f2413b0 | 28 | |
| matthiaskosch | 0:b65c5f2413b0 | 29 | |
| matthiaskosch | 0:b65c5f2413b0 | 30 | |
| matthiaskosch | 0:b65c5f2413b0 | 31 | Date rtc; // instanziieren des Objektes rtc |
| matthiaskosch | 0:b65c5f2413b0 | 32 | |
| matthiaskosch | 0:b65c5f2413b0 | 33 | while(1) { |
| matthiaskosch | 0:b65c5f2413b0 | 34 | pc.printf("DateString.Day: %i\n", rtc.GetDay()); |
| matthiaskosch | 0:b65c5f2413b0 | 35 | pc.printf("DateString.GetDay: %s\n", rtc.GetDay("Where am I?")); |
| matthiaskosch | 0:b65c5f2413b0 | 36 | wait(1); |
| matthiaskosch | 0:b65c5f2413b0 | 37 | } |
| matthiaskosch | 0:b65c5f2413b0 | 38 | } |
| matthiaskosch | 0:b65c5f2413b0 | 39 | |
| matthiaskosch | 0:b65c5f2413b0 | 40 | |
| matthiaskosch | 0:b65c5f2413b0 | 41 | /*Ask a question Start a discussion |
| matthiaskosch | 0:b65c5f2413b0 | 42 | Repository toolbox |
| matthiaskosch | 0:b65c5f2413b0 | 43 | |
| matthiaskosch | 0:b65c5f2413b0 | 44 | Embed: |
| matthiaskosch | 0:b65c5f2413b0 | 45 | Import this program |
| matthiaskosch | 0:b65c5f2413b0 | 46 | Export to desktop IDE |
| matthiaskosch | 0:b65c5f2413b0 | 47 | Build repository |
| matthiaskosch | 0:b65c5f2413b0 | 48 | Send Pull Request from here |
| matthiaskosch | 0:b65c5f2413b0 | 49 | */ |