RTC on M0 and class design without rtc and target
Quote:
Example for training purposes only!!!
RTC/I2C data for target LPC11U24 Humer M0-Board and no data for others!!!
See RTC WIKI
Clock.cpp@0:397b5462e6d7, 2018-11-15 (annotated)
- Committer:
- fpucher
- Date:
- Thu Nov 15 06:55:25 2018 +0000
- Revision:
- 0:397b5462e6d7
ifdef target
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fpucher | 0:397b5462e6d7 | 1 | #include "rtc.h" |
fpucher | 0:397b5462e6d7 | 2 | #include "string" |
fpucher | 0:397b5462e6d7 | 3 | #include "Datestr.h" |
fpucher | 0:397b5462e6d7 | 4 | #include "Time.h" |
fpucher | 0:397b5462e6d7 | 5 | #include "Clock.h" |
fpucher | 0:397b5462e6d7 | 6 | |
fpucher | 0:397b5462e6d7 | 7 | string Clock::Print() |
fpucher | 0:397b5462e6d7 | 8 | { |
fpucher | 0:397b5462e6d7 | 9 | char buffer[40]; |
fpucher | 0:397b5462e6d7 | 10 | sprintf(buffer, "Datum = %d/%d/%d Zeit = %d:%02d:%02d\n", GetYear(), GetMonth(), GetDay(), GetHours(), GetMinutes(), GetSeconds()); // Plain Old Data |
fpucher | 0:397b5462e6d7 | 11 | //sprintf(buffer, "Zeit = %d:%02d:%02d\n", GetHours(), GetMinutes(), GetSeconds()); |
fpucher | 0:397b5462e6d7 | 12 | return buffer; |
fpucher | 0:397b5462e6d7 | 13 | } |