Pseudo real-time clock using Ticker interruption, also implements time() and set_time() for platforms that don't (such as mBuino)
Fork of PseudoRTC by
Diff: PseudoRTC.h
- Revision:
- 1:fb8fd750e935
- Parent:
- 0:9ab044e24d20
- Child:
- 2:7d153bc7403f
--- a/PseudoRTC.h Sat Sep 20 14:18:46 2014 +0000 +++ b/PseudoRTC.h Sat Sep 20 14:25:38 2014 +0000 @@ -21,6 +21,26 @@ #include "mbed.h" +/** Example: + * @code + * #include "mbed.h" + * #include "PseudoRTC.h" + * + * PseudoRTC c; + * + * main() + * { + * /* Example: September 20, 2014, 21:05:30 + * c.setTime(2014, 09, 20, 21, 05, 30); + * + * while(true) { + * printf("%04d/%02d/%02d %02d:%02d:%02d\r\m", c.getYear(), c.getMonth(), c.getDay(), c.getHour(), c.getMinute(), c.getSecond()); + * wait(1); + * } + * } + * @endcode + */ + class PseudoRTC { public: