nitred 2 Posted November 19, 2014 Share Posted November 19, 2014 Hi, I've made a very simple RTC library using the RTC method in the PRCM library. It is intended for the CC3200 Launchpad and has only been tested on the CC3200 Launchpad so far. Overview: Uses the PRCM library It follows UNIX Time It was made with the "Time" library of the Sparkcore in mind. It has the following methods:ccRTC.zone() ccRTC.now() ccRTC.year() ccRTC.month() ccRTC.day() ccRTC.weekday() ccRTC.hour() ccRTC.minute() ** ccRTC.begin() Limitations: (Unfortunately there are a few actual limitations) It is accurate to only about 4 seconds an hour. (That is pretty bad, but can it can be used for non time critical applications if time is synced with an online server regularly) My tests haven't shown any issues so far, but it is not foolproof yet. If you're using an NTP server to sync time, then you'll need to convert it to UNIX time first before you use the ccRTC.setTime() You can get the code and a basic guide from here : https://github.com/nitred/ccRTC Additional Documentation for the the functionality can be found here : http://docs.spark.io/firmware/#libraries-timeIt Its a work in progress and I know for a fact that there's a better way to do it than this but I really needed this library and I hope you find it helpful too. Any and all feedback and improvements are welcome! bluehash and reaper7 2 Quote Link to post Share on other sites
igor 163 Posted November 19, 2014 Share Posted November 19, 2014 Is the API compatible with that of some other RTC libraries? If not, might think about making it more similar. I do not know of a particular API that is defacto standard in Arduino circles, or in Energia. But there are already a few Energia RTC libraries, and I am sure there are several for Arduino as well. Would be nice to have things work across multiple devices. e.g. http://forum.43oh.com/topic/5421-energia-library-rtc-a/ http://forum.stellarisiti.com/topic/2026-calendar-mode-with-tm4c1294/ Rickta59 1 Quote Link to post Share on other sites
nitred 2 Posted November 20, 2014 Author Share Posted November 20, 2014 I don't think the API is fully compatible with other Libraries or Arduino's. I think I'll slowly work towards it. At the moment however I'm not sure there's libraries that will work with the CC3200 Launchpad so I was just filling the space, since I needed an RTC Library for myself. I'm more than happy to deprecate this one if a better library comes up. Thanks for the direction igor. Quote Link to post Share on other sites
bluehash 1,581 Posted November 20, 2014 Share Posted November 20, 2014 @@nitred Thank you for sharing! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.