spirilis 1,265 Posted August 21, 2014 Share Posted August 21, 2014 Inspired by @@B@tto 's RTC_A library located here -- http://forum.43oh.com/topic/5421-energia-library-rtc-a/ -- I wanted an RTC_B library for doing work with my Wolverine LaunchPad. So after realizing his library wouldn't compile on the Wolverine correctly, I looked into the user's guide and realized the RTC_B has quite a few changes over the RTC_A, so it was better to just start from scratch. So I made a library that I think does the job quite well. See https://github.com/spirilis/RTC_B The documentation is drafted directly into the README.md file shown on the main page. The library contains 4 examples to showcase its features. One feature that is noteworthy here is the .save() and .restore() feature--the library automatically allocates a 9-byte FRAM buffer in the ".text" section which can store a copy of the current date/time info when the user runs rtc.save() in the sketch, and upon reset the sketch can be programmed to run rtc.restore() -- this function returns "true" if the FRAM segment was initialized with legitimate date/time data, or "false" if it was not (e.g. after initially uploading a sketch). The time buffer is only 8 bytes but the 9th byte holds a magic cookie which indicates whether the buffer has date/time info stored or not. But in addition to all that, the library supports string output with rtc.getTimeString() ... this doesn't use the String class, but rather stores its data in a char * buffer supplied by you. The string output is configurable too, with the rtc.setTimeStringFormat() function. Anyway my initial requirement that prompted the creation of this library is an in-FRAM table for storing Lightning Sensor strike data from the AS3935 Franklin Lightning Sensor which I received recently from TAUTIC at Tindie.com. I hope this library proves useful to other Wolverine users and as always if there are any bugs or questions, post in here and let me know! RobG 1 Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.