Search the Community
Showing results for tags 'unix-time'.
Found 1 result
nitred posted a topic in MSP Energia LibrariesHi, 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!