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
Datestr.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 "Datestr.h" |
fpucher | 0:397b5462e6d7 | 2 | #include "string" |
fpucher | 0:397b5462e6d7 | 3 | |
fpucher | 0:397b5462e6d7 | 4 | string Datestr::toString(uint8_t value) |
fpucher | 0:397b5462e6d7 | 5 | { |
fpucher | 0:397b5462e6d7 | 6 | //return std::to_string(value); // C++ version 11 |
fpucher | 0:397b5462e6d7 | 7 | char buffer[2]; |
fpucher | 0:397b5462e6d7 | 8 | sprintf (buffer, "%d", value); // ToString() |
fpucher | 0:397b5462e6d7 | 9 | return buffer; |
fpucher | 0:397b5462e6d7 | 10 | } |
fpucher | 0:397b5462e6d7 | 11 | |
fpucher | 0:397b5462e6d7 | 12 | string Datestr::GetDay(uint8_t value) |
fpucher | 0:397b5462e6d7 | 13 | { |
fpucher | 0:397b5462e6d7 | 14 | day = "Datestr " + toString(value); |
fpucher | 0:397b5462e6d7 | 15 | return day; |
fpucher | 0:397b5462e6d7 | 16 | } |