Schüler NWT
/
WF_RTC
a
main.cpp@0:ae1ce8847fe3, 2015-01-28 (annotated)
- Committer:
- bulmenwt
- Date:
- Wed Jan 28 07:53:49 2015 +0000
- Revision:
- 0:ae1ce8847fe3
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bulmenwt | 0:ae1ce8847fe3 | 1 | /*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015 |
bulmenwt | 0:ae1ce8847fe3 | 2 | BULME Graz / Elektronik |
bulmenwt | 0:ae1ce8847fe3 | 3 | |
bulmenwt | 0:ae1ce8847fe3 | 4 | Polling eines Tasters |
bulmenwt | 0:ae1ce8847fe3 | 5 | |
bulmenwt | 0:ae1ce8847fe3 | 6 | Datei: WF_taster_polling/main.cpp |
bulmenwt | 0:ae1ce8847fe3 | 7 | |
bulmenwt | 0:ae1ce8847fe3 | 8 | */ |
bulmenwt | 0:ae1ce8847fe3 | 9 | |
bulmenwt | 0:ae1ce8847fe3 | 10 | #include "mbed.h" |
bulmenwt | 0:ae1ce8847fe3 | 11 | |
bulmenwt | 0:ae1ce8847fe3 | 12 | int main() { |
bulmenwt | 0:ae1ce8847fe3 | 13 | while(1) { |
bulmenwt | 0:ae1ce8847fe3 | 14 | time_t seconds = time(NULL); |
bulmenwt | 0:ae1ce8847fe3 | 15 | |
bulmenwt | 0:ae1ce8847fe3 | 16 | printf("Time as seconds since January 1, 1970 = %d\n", seconds); |
bulmenwt | 0:ae1ce8847fe3 | 17 | |
bulmenwt | 0:ae1ce8847fe3 | 18 | printf("Time as a basic string = %s", ctime(&seconds)); |
bulmenwt | 0:ae1ce8847fe3 | 19 | |
bulmenwt | 0:ae1ce8847fe3 | 20 | char buffer[32]; |
bulmenwt | 0:ae1ce8847fe3 | 21 | strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds)); |
bulmenwt | 0:ae1ce8847fe3 | 22 | printf("Time as a custom formatted string = %s", buffer); |
bulmenwt | 0:ae1ce8847fe3 | 23 | |
bulmenwt | 0:ae1ce8847fe3 | 24 | wait(1); |
bulmenwt | 0:ae1ce8847fe3 | 25 | } |
bulmenwt | 0:ae1ce8847fe3 | 26 | } |